I am using MPMoviePlayerController to play live streaming m3u8 video for iOS 3.1.2. It opens in full screen landscape, which is fine. However, usually after playing for 10-20 seconds, the screen resizes on its own. The screen maintains its width, but shrinks the height, resulting in a narrow, stretched image. I don't have this problem when playing pre-recorded mp4 videos, though.
Any idea what's going on and how to fix it?
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];