gpt4 book ai didi

ios - MPMoviewPlayer错误[播放]❗️无法将任何项目排队

转载 作者:行者123 更新时间:2023-12-01 16:23:41 24 4
gpt4 key购买 nike

在使用 iOS SDK 10.3.x 升级到 XCode 8.3.3 后,我面临以下错误:

[回放]❗️回放失败,错误:错误域= AVFoundationErrorDomain代码= -11800“操作无法完成” UserInfo = {NSUnderlyingError = 0x17425a8b0 {Error Domain = NSOSStatusErrorDomain Code = 1885696621“(null)”},NSLocalizedFailureReason =未知发生错误(1885696621),NSLocalizedDescription =操作无法完成},无法解决(canResolve:是,errorResolver :(空))

[播放]❗️无法将任何项目排队...

这是我的代码:

//ViewDidLoad
NSString *videoFilePath = [videoPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

MPMoviePlayerController * moviePlayer = [[MPMoviePlayerController alloc] init];
NSURL *videoURL = [NSURL fileURLWithPath:videoFilePath];
[moviePlayer setContentURL:videoURL];
moviePlayer.controlStyle = MPMovieControlStyleNone;
moviePlayer.shouldAutoplay = YES;
moviePlayer.fullscreen = NO;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playMovie:) name:MPMoviePlayerLoadStateDidChangeNotification object:moviePlayer];

实现选择器:
- (void)playMovie:(NSNotification *)notification {
MPMoviePlayerController *player = notification.object;
if (player.loadState & MPMovieLoadStatePlayable) {
[player play];
//Other lines
}
}

- (void)moviePlayBackDidFinish:(NSNotification*)notification {
MPMoviePlayerController *player = [notification object];
[player stop];
[player.view removeFromSuperview];
}

编辑1:我完全知道iOS 9.0之后就敬重MPMoviePlayer。还有其他选择吗?

最佳答案

评论movieSourceType为我工作:

//self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;

关于ios - MPMoviewPlayer错误[播放]❗️无法将任何项目排队,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44498546/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com