Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player.currentItem.error Error Domain=AVFoundationErrorDomain Code=-11800 "这项操作无法完成" UserInfo={NSLocalizedFailureReason=发生未知错误(-17377), NSLocalizedDescription=这项操作无法完成, NSUnderlyingError=0x2805904b0 {Error Domain=NSOSStatusErrorDomain Code=-17377 "(null)"}} #80

Open
FuquanXiao opened this issue Mar 10, 2022 · 1 comment

Comments

@FuquanXiao
Copy link

不时的会报这个错误,导致所有音频都无法播放,重新安装APP 甚至卸载APP重装也无用,但重启手机之后就好了(今天没重启昨晚不行,今天早上试了下可以播放了)跟踪代码是因为AVAssetResourceLoaderDelegate的代理没有执行

  • (AVPlayerItem *)playerItemWithURL:(NSURL *)url {
    NSURL *assetURL = [VIResourceLoaderManager assetURLWithURL:url];
    AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:assetURL options:nil];
    [urlAsset.resourceLoader setDelegate:self queue:dispatch_get_main_queue()];
    AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:urlAsset];
    if ([playerItem respondsToSelector:@selector(setCanUseNetworkResourcesForLiveStreamingWhilePaused:)]) {
    playerItem.canUseNetworkResourcesForLiveStreamingWhilePaused = YES;
    }
    return playerItem;
    }
    打印这里面的url 是对的(VIMediaCache_:https......)格式

为什么代理不执行呢?手机重启之后执行到底在释放什么呢?

请指教 多谢

@FuquanXiao
Copy link
Author

问题补充 iOS14 上出现的问题 在进入后台时设置了通道为 :
AVAudioSessionCategoryOptions option = session.categoryOptions | AVAudioSessionCategoryOptionAllowBluetooth;
if (option != session.categoryOptions || ![session.category isEqualToString:AVAudioSessionCategoryPlayAndRecord]) {
[session setCategory:AVAudioSessionCategoryPlayAndRecord mode:AVAudioSessionModeVoiceChat options:option error:&error];
[session setActive:YES error:&error];
}
但是我不能修改这个设置代码,因为项目中的视频会议需要在后台的时候设置成这样;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant