【发布时间】:2013-02-25 12:50:31
【问题描述】:
我正在我的应用程序的 MPMoviePlayer 中播放视频,我正在从服务器获取视频。 如果视频长度大约为 25 秒或更长,则音频会中断。意味着在播放视频时,当视频播放到一半时,就听不到音频了。但是如果我寻找进度条,音频又来了。
有人可以帮我吗?
moviePlayerController = [[MPMoviePlayerController alloc] init];
[moviePlayerController prepareToPlay];
moviePlayerController.shouldAutoplay = YES;
[moviePlayerController setScalingMode:MPMovieScalingModeAspectFit];
[[self.moviePlayerController view] setFrame:CGRectMake(0, 72, 320,180)];
[[self view] addSubview: [self.moviePlayerController view]];
self.moviePlayerController.useApplicationAudioSession = YES;
NSString *strng = @"http://qdemo_videos.s3.amazonaws.com/1360582540.mp4";
NSURL * adurl = [NSURL URLWithString:strng];
moviePlayerController.contentURL = url;
moviePlayerController.controlStyle = YES;
self.moviePlayerController.useApplicationAudioSession = YES;
[moviePlayerController play];
【问题讨论】:
-
在您的常规移动 Safari 浏览器中测试该确切的视频文件/流,以确定问题是否与您的代码有关。提示:这不是你的代码,而是编码问题。
-
完全正确..谢谢你,直到如何做到这一点??
-
@NithinMK 你得到解决方案了吗?
-
是的..这是在服务器端转换问题
标签: iphone ios mpmovieplayercontroller mpmovieplayer