【发布时间】:2015-06-17 06:26:31
【问题描述】:
我使用MPMoviePlayerController 播放HLS 即video streaming 它在良好和普通的网络(WIFI,3G) 上运行良好,但在慢速网络(2G) 上无法正常运行。下面是一段相同的代码。
同样在慢速网络上,seekbar 会导致问题,它向上移动并且播放器显示空白屏幕。
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] init];
player.allowsAirPlay = YES;
[self.view addSubview:player.view];
player.view.frame = CGRectMake(5.0, 64.0, [[UIScreen mainScreen] bounds].size.width - 10.0, viwVideo.frame.size.height - 10.0);
player.controlStyle = MPMovieControlStyleDefault;
player.movieSourceType = MPMovieSourceTypeFile;
[player setContentURL:[NSURL URLWithString:@"http://techxvweb.fr/html5/AppleOutput/2012-03-10-j23-dax-smr-mt1-m3u8-aapl.ism/manifest(format=m3u8-aapl)
"]];
[player play];
【问题讨论】:
-
2g的典型带宽是250kbps。你的视频流的比特率是多少?
-
大约 400-4700 kbps 是视频的 birate.of。这是关注点吗?
-
@PoojaM.Bohora ....是的...慢速网络上的高比特率可能会导致此问题。
-
@PoojaM.Bohora 很抱歉耽搁了这么久。在网络容量仅为 250kbps 的情况下,无法下载和播放比特率为 400kbits(或更高)的任何视频流。播放器根本无法足够快地下载所需的信息,它会停止并显示空白(暗)屏幕。总而言之,2g 从未用于视频(更像是电子邮件和聊天)。
-
这是一个关于如何支持多种比特率以在不同网络功能中使用的链接:developer.apple.com/library/ios/technotes/tn2224/_index.html#//…
标签: ios video-streaming mpmovieplayercontroller http-live-streaming