【问题标题】:How can I stream video from a video hidden inside a URL iOS?如何从隐藏在 URL iOS 中的视频流式传输视频?
【发布时间】:2013-05-27 17:16:11
【问题描述】:

我目前正在为我的应用添加视频支持。

唯一的问题是似乎没有任何流式视频的方法有效。

这是我正在生成的 url 的格式:

http://jerwuqu.appspot.com/SnapGrapple?v=1&username=testacchere&videoid=620672369494608704r&authtoken=f6152fb6-b17a-4256-94d1-1280df34ace0

我已经尝试在 web 视图中加载它,但我得到一个禁用的播放按钮和插件错误。

我也尝试过像这样使用 MPMoviePlayerController 加载它:

NSURL *fileURL = [NSURL URLWithString:stringURL];

     moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; 
     [moviePlayerController.view setFrame:CGRectMake(0, 70, 320, 270)]; 
     [self.view addSubview:moviePlayerController.view];  
     moviePlayerController.fullscreen = YES;  
     [moviePlayerController play];  

其中 stringURL 是生成的 url。在这种方法中,movieplayer 会立即关闭,并且根本不起作用。

有人对我如何使它工作有任何建议吗?

【问题讨论】:

  • 确保您使用 apple's tools 测试您的流(分段和编码)。

标签: ios video-streaming mpmovieplayercontroller


【解决方案1】:

问题不在于视频的网址,而在于其编码。我尝试使用 VLC 使用 MPEG-4 视频编解码器以 1024kb/s 重新编码它,它在我的 iPhone 上播放得恰到好处。

this question for the video formats supported by iOS

【讨论】:

  • 嗯,这不是编码,现在应该是正确的编码。这是官方 SnapChat 应用程序中使用的编码,他们能够以某种方式流式传输视频。你知道怎么做吗?
  • 我不知道 SnapChat,也许可以用苹果的验证工具试试 Till 的提议。
猜你喜欢
  • 1970-01-01
  • 2014-06-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-07-02
  • 2015-06-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多