我正在使用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