【问题标题】:How does instagram and vine iOS apps play videos inline? [closed]instagram 和 vine iOS 应用如何内联播放视频? [关闭]
【发布时间】:2014-01-05 02:38:53
【问题描述】:

没有打开全屏视频播放器?

他们使用的是网络视图吗?视频格式是什么?

【问题讨论】:

  • 我会假设他们使用 AVPlayer,因为你可以自定义更多(大小:你不必让它全屏,你可以一次播放 2 个视频.. 等等),然后得到来自他们服务器的视频数据。

标签: ios iphone ios7


【解决方案1】:

我使用 Reveal 检查了 Instagram 应用,看起来他们使用的是 AVPlayer,这使得他们能够比使用 UIWebViewMPMoviePlayerController 更多地自定义它。

【讨论】:

  • 您是如何使用 Reveal 检查第三方应用程序的?
  • 我用的是越狱设备,关注this post。我认为现在有一个 Cydia 包可以使它更容易。
【解决方案2】:

使用/尝试下面的代码,这是我希望的工作。

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];

通过 UIWebView 类委托方法尝试第二种方法

allowsInlineMediaPlayback

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-29
    • 2020-03-20
    • 1970-01-01
    • 2016-02-08
    相关资源
    最近更新 更多