【发布时间】:2011-04-19 01:47:22
【问题描述】:
我正在使用 MPMoviePlayerController 为旧设备 (3.1.2) 播放实时流媒体 m3u8 视频。直到今天早上,这一切都很好。我尝试更改 scalingMode 来解决另一个问题,但现在播放器根本无法工作。我回到了旧的备份,但它们也不起作用。
在调试时,控制进入 [mMPPlayer 播放] 并且永远不会返回。这也会锁定我的应用程序。
MPMoviePlayerController 发生了什么变化,还是我在 XCode 中破坏了某些东西?
我的应用程序计划今天开始投入生产,所以我真的陷入了困境,在这里。 :(
这是我收到的警告:
警告: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];
NSLog("Control never returns to here");
【问题讨论】:
-
你升级了 xcode 或 iPhone sdk 了吗?还是流文件有什么变化?
-
该警告是正常的,可以忽略。尝试另一个流 - 例如苹果的 blip-blop 示例。也许更改发生在您的服务器上,而不是您的客户端上。
-
谢谢,直到。您有指向 blip-blop 示例的链接吗?我很难找到它。'
标签: iphone video streaming mpmovieplayercontroller