我正在使用MPMoviePlayerController播放用于iOS 3.1.2的直播m3u8视频。它全屏显示,这很好。但是,通常在播放10-20秒后,屏幕会自行调整大小。屏幕保持其宽度,但缩小高度,导致缩小,拉伸的图像。但是,在播放预录制的mp4视频时,我没有这个问题。MPMoviePlayerController延伸/扭曲直播视频(m3u8)
任何想法是怎么回事以及如何解决它?
这里是我的代码:
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];
我尝试了你列出的适合和填充模式,但它仍然不起作用。它最初起作用。但是,玩家在片刻之后仍然会调整大小。 m3u8有什么特别的可能导致我的问题? – user359519 2011-04-19 20:07:00
我尝试使用苹果的blip blop feed播放我的播放器:http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8。到目前为止,没有调整大小。这表明我的Feed的编码可能存在问题。我会和那些为我的Feed设置编码的人聊聊。 – user359519 2011-04-19 20:25:42