问题描述
我正在尝试为iPad创建一个简单的应用程序,当您单击按钮时播放FLV。我正在使用作为参考。以下是我点击事件的代码
I am trying to create a simple app for the iPad that with play an FLV when you click a button. I am using the code from http://developer.apple.com/iphone/library/codinghowtos/AudioAndVideo/index.html#VIDEO-USE_THE_MEDIA_PLAYER_FRAMEWORK_FOR_VIDEO_PLAYBACK as a reference. Here is the code for my click event
-(IBAction) btnPlayVideoClick:(id) sender {
NSString* videoPath = [[NSBundle mainBundle] pathForResource:@"myVideo" ofType:@"flv"];
MPMoviePlayerController* myMovie = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:videoPath]];
myMovie.scalingMode = MPMovieScalingModeAspectFill;
// Register for the playback finished notification.
[[NSNotificationCenter defaultCenter] addObserver:self
selector: @selector(myMovieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:myMovie];
[myMovie play];
}
-(void)myMovieFinishedCallback:(NSNotification*)aNotification
{
MPMoviePlayerController* theMovie=[aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:theMovie];
// Release the movie instance created in playMovieAtURL
[theMovie release];
}
我能够成功编译并运行应用程序,但是当我点击按钮应用程序退出时没有任何错误消息或任何活动。有什么东西我做错了,或者是否有某些原因我无法使用模拟器播放FLV。我无法在真实设备上进行测试,因为我正在等待批准获得我的开发许可证。
I am able to successfully compile and run the app, but when I click the button the app just exits with no error message or any activity at all. Is there something that I am doing wrong, or is there some reason I cannot play an FLV using the simulator. I can't test on a real device yet because I am waiting for approval to get my dev license.
谢谢,
Mike
推荐答案
iOS设备没有Flash,因此您无法播放任何Flash视频。
iOS devices do not have Flash, so you can't play any Flash video.
这篇关于我可以在iPad模拟器上播放FLV吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!