问题
Without opening the fullscreen video player?
Are they using a webview? What is the format of the video?
回答1:
I inspected Instagram app using Reveal and looks like they use an AVPlayer
, which makes them able to customize it more than if they were using an UIWebView
or MPMoviePlayerController
.
回答2:
use/try below code it's works i hoped.
NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;
color: white;
}\
</style>\
</head><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
NSString *htmlString = [NSString stringWithFormat:embedHTML, yourURLString, width,height];//set width and height
[webView loadHTMLString:htmlStr baseURL:nil];
[self.view addSubview:webView];
or
use try second approach via UIWebView class delegates method
allowsInlineMediaPlayback
来源:https://stackoverflow.com/questions/20929380/how-does-instagram-and-vine-ios-apps-play-videos-inline