8

I am using MPMoviePlayerController for playing HLS i.e video streaming it works fine on good and average network (WIFI,3G) but not working properly on slow network (2G). Below is the piece of code for the same. Also on slow network seekbar is causing an issue, it moves upwards and player shows blank screen.

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];
7
  • The typical bandwidth of 2g is 250kbps. What's the bitrate of you video stream? Jun 17, 2015 at 8:13
  • Around 400-4700 kbps is the birate.of the video. Is this the point of concern? Jun 17, 2015 at 9:02
  • 1
    @PoojaM.Bohora ....Yes... high bit rate on slow network can cause this issue. Jun 25, 2015 at 9:46
  • 1
    @PoojaM.Bohora sorry for the long delay. It's impossible to download and play any video stream that has a bitrate of 400kbits (or higher) while the network capacity is just 250kbps. The player simply cannot download the info it needs fast enough, it stalls, and shows a blank (dark) screen. All and all, 2g has never been intended for video (more like email and chat). Jun 26, 2015 at 8:37
  • 1
    Here is a link about how to support many bit rates to use in different networks capabilities: developer.apple.com/library/ios/technotes/tn2224/_index.html#//… Jun 29, 2015 at 13:29

2 Answers 2

2

Apple's docs say:

First bit rate should be one that most clients can sustain The first entry in the variant playlist will be played at the initiation of a stream and is used as part of a test to determine which stream is most appropriate. The order of the other streams is irrelevant. Therefore, the first bit rate in the playlist should be the one that most clients can sustain.

You should create multiple playlists that have the same set of streams, but each with a different first entry that is appropriate for the target network. This ensures the user has a good experience when the stream is first played.

We recommend you point to a 150 Kbps stream for the cellular Variant Playlist.

We recommend you point to a 440 Kbps stream for the Wi-Fi Variant Playlist.

See Recommended Encoding Settings for HTTP Live Streaming Media.

Where possible, encode enough variants to provide the best quality stream across a wide range of connection speeds For example, encode variants at 64 Kbps, 110 Kbps, 200 Kbps, 350 Kbps, 550 Kbps, 900 Kbps and 1500 Kbps.

Audio/Video Stream Considerations Video aspect ratio must be exactly the same, but can be different dimensions.

We recommend 416 x 234 for 16:9 content and 400 x 300 for 4:3 content

-1

This is the the property of MPMoviePlayerController, If you play an audio file you will notice that seeker is permanently in center with blank screen till it gets next stream of data. Here you can add some loader in blank screen. also you can set the property of ShouldAutoPlay to No.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.