开发者

MPMoviePlayerController stopped working in 3.1.2

开发者 https://www.devze.com 2023-02-26 05:58 出处:网络
I am using MPMoviePlayerController to play a live streaming m3u8 video for older devices (3.1.2).This worked fine until this morning.I tried changing the scalingMode to resolve another issue, and now

I am using MPMoviePlayerController to play a live streaming m3u8 video for older devices (3.1.2). This worked fine until this morning. I tried changing the scalingMode to resolve another issue, and now the player does not work at all. I went back to older backups that worked, and they don't wo开发者_运维百科rk, either.

While debugging, control goes into [mMPPlayer play] and never returns. This also locks up my app.

Has something changed with MPMoviePlayerController, or did I break something in XCode?

My app was scheduled to start moving to production today, so I'm really in a bind, here. :(

Here's the warning that I get:

Warning: MPMoviePlayerController may not support file of type m3u8

And here's my code:

MyViewController.h:

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>

@interface WatchNowViewController : UIViewController {
    MPMoviePlayerController *mMPPlayer;
}
@property (nonatomic, retain)           MPMoviePlayerController *mMPPlayer;

@end

MyViewController.m:

        mMPPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://www.mysite.com/myVideo.m3u8"]];
        mMPPlayer.scalingMode=MPMovieScalingModeFill;
        mMPPlayer.backgroundColor=[UIColor blackColor];
        [mMPPlayer play];
NSLog("Control never returns to here");


Happened to us as well. Not sure what went wrong. The encrypted streams just stopped playing in 3.2. Try the m3u8 url in the iPad safari and check if it plays there. If it doesn't play in iPad safari as well, try an unencrypted stream. As per my experience, an unencrypted stream played in 3.2 without issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消