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

线上版本播放视频崩溃 已经崩溃了两百多次了 需要帮忙 需要协助 #35

Closed
yuechen1992 opened this issue Jun 8, 2017 · 20 comments

Comments

@yuechen1992
Copy link

线上崩溃:
An AVPlayerItem cannot be associated with more than one instance of AVPlayer (_mh_execute_header + 1613604)

线上崩溃捕获到的日志:
2017-06-07 07:57:53.837 BTGAspects: Unable to find selector -[NSURLSessionConfiguration setProtocolClasses:].
2017-06-07 07:57:55.094 BUGTAGS: Bugtags v2.3.0(0510) started successfully
2017-06-07 07:58:27.002 [PLV_SDK_INFO] 播放在线视频,自动。
2017-06-07 08:21:32.107 ::: Socket broke, syncing message ..

崩溃步骤:
2017-06-07 08:01:40.588 Selector playButtonClick by (UIButton) in SkinVideoViewController
2017-06-07 08:01:58.904 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView) in EHCourseReplayController
2017-06-07 08:02:05.355 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView) in EHCourseReplayController
2017-06-07 08:02:06.205 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView):_bottomBar(UIView) in EHCourseReplayController
2017-06-07 08:02:07.915 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView) in EHCourseReplayController
2017-06-07 08:02:08.661 Selector progressSliderTouchBegan: by (UISlider) in SkinVideoViewController
2017-06-07 08:02:08.676 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView):_slider(PLVSlider):_slider(UISlider) in EHCourseReplayController
2017-06-07 08:02:08.752 Selector progressSliderValueChanged: by (UISlider) in SkinVideoViewController
2017-06-07 08:02:08.767 Selector progressSliderValueChanged: by (UISlider) in SkinVideoViewController
2017-06-07 08:02:08.783 Selector progressSliderValueChanged: by (UISlider) in SkinVideoViewController
2017-06-07 08:02:08.982 Selector progressSliderTouchEnded: by (UISlider) in SkinVideoViewController
2017-06-07 08:02:10.794 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView) in EHCourseReplayController
2017-06-07 08:02:17.641 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView):_pauseButton(UIButton) in EHCourseReplayController
2017-06-07 08:02:17.736 Selector pauseButtonClick by (UIButton) in SkinVideoViewController
2017-06-07 08:02:54.464 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView) in EHCourseReplayController
2017-06-07 08:02:55.525 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView):_playButton(UIButton) in EHCourseReplayController
2017-06-07 08:02:55.673 Selector playButtonClick by (UIButton) in SkinVideoViewController
2017-06-07 08:07:22.896 Application WillResignActive
2017-06-07 08:07:24.920 Application DidBecomeActive
2017-06-07 08:14:03.800 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView) in EHCourseReplayController
2017-06-07 08:14:04.581 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView):_pauseButton(UIButton) in EHCourseReplayController
2017-06-07 08:14:04.747 Selector pauseButtonClick by (UIButton) in SkinVideoViewController
2017-06-07 08:15:27.010 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView):_playButton(UIButton) in EHCourseReplayController
2017-06-07 08:15:27.157 Selector playButtonClick by (UIButton) in SkinVideoViewController
2017-06-07 08:16:49.332 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView) in EHCourseReplayController
2017-06-07 08:21:06.671 Application WillResignActive
2017-06-07 08:21:07.313 Application DidEnterBackground
2017-06-07 08:21:08.038 Application WillEnterForeground
2017-06-07 08:21:08.554 Application DidBecomeActive
2017-06-07 08:21:09.723 Touch _webView(UIWebView):(MPMovieView):(SkinVideoViewControllerView):_playButton(UIButton) in EHCourseReplayController
2017-06-07 08:21:09.815 Selector playButtonClick by (UIButton) in SkinVideoViewController
2017-06-07 08:21:13.580 Application WillResignActive
2017-06-07 08:21:14.128 Application DidEnterBackground

@bqlin
Copy link
Collaborator

bqlin commented Jun 8, 2017

是否在播放器未销毁时 创建新播放器

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

应该不会 我们看捕获到的崩溃前的操作步骤 没有退出 用户一直在播放、暂停

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

- (void)setReplayInfo:(EHOCReplayModel *)replay
{
    if (!_videoPlayer) {
        [_webView layoutIfNeeded];
        _videoPlayer = [[SkinVideoViewController alloc] initWithFrame:_webView.bounds];
        [_webView addSubview:_videoPlayer.view];
        [_videoPlayer setParentViewController:self];
        [_videoPlayer keepNavigationBar:YES];
        [_videoPlayer setHeadTitle:_replay.title];
        [_videoPlayer setNavigationController:self.navigationController];
        [_videoPlayer setMovieSourceType:MPMovieSourceTypeStreaming];
        
        [_videoPlayer setVid:_replay.poly_id];
        [_videoPlayer enableDanmu:NO];
        [_videoPlayer setEnableDanmuDisplay:NO];    // 不显示弹幕按钮
        
        // 注册监听
        [_videoPlayer configObserver];
        __weak typeof(self) weakself = self;
        [_videoPlayer setFullscreenBlock:^{
            weakself.titleLbl.hidden = TRUE;
            weakself.titleImgView.hidden = TRUE;
        }];
        [_videoPlayer setShrinkscreenBlock:^{
            weakself.titleLbl.hidden = FALSE;
            weakself.titleImgView.hidden = FALSE;
        }];
    }
}

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

这个是初始化的方法 这个方法只执行一次 用户一致保持在播放视频的界面 但是用户不停的最小化 在返回 在最小化 在返回 然后点暂停 播放 暂停 播放 最后就出现了崩溃

@bqlin
Copy link
Collaborator

bqlin commented Jun 8, 2017

我看看你怎么销毁播放器的

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

 - (void)viewWillAppear:(BOOL)animated
{
    if (self.navigationController.navigationBarHidden) {
        [self.navigationController setNavigationBarHidden:NO animated:YES];
    }
    [super viewWillAppear:animated];
    
    // 续播
    if (_videoPlayer) {
        [_videoPlayer configObserver];
        [_videoPlayer play];
    }
    
    // 打开旋转响应
    AppDelegate *deletege = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    deletege.clientstate = 1;
}
- (void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES animated:YES];
    [super viewWillDisappear:animated];
    
    // 暂停
    if (_videoPlayer) {
        [_videoPlayer cancelObserver];
        [_videoPlayer pause];
    }
    
    // 关闭旋转响应
    AppDelegate *deletege = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    deletege.clientstate = 0;
}
- (void)dealloc
{
    [_videoPlayer stop];
    _videoPlayer.contentURL = nil;
    [_videoPlayer cancel];
}

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

 - (void)viewDidLoad
{
    [super viewDidLoad];

    if ([_replay.platform isEqualToString:@"GRE"]) {
        [_headImgView setImage:[UIImage imageNamed:@"course_bg_headgre"]];
    } else if ([_replay.platform isEqualToString:@"GMAT"]) {
        [_headImgView setImage:[UIImage imageNamed:@"course_bg_headgmat"]];
    } else if ([_replay.platform isEqualToString:@"雅思"]) {
        [_headImgView setImage:[UIImage imageNamed:@"course_bg_headielts"]];
    }

    _webView.scrollView.scrollEnabled = FALSE;
    [_webView changeBackColor:[UIColor clearColor]];
    _webView.allowsInlineMediaPlayback = YES;

    [self setReplayInfo:_replay];
}

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

 - (void)popSelfAction
{
    [self.navigationController popViewControllerAnimated:YES];
}

@bqlin
Copy link
Collaborator

bqlin commented Jun 8, 2017

该视图控制器时候销毁 delloc 是否执行

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

我这边确认了一下 如果用户返回的话 dealloc 会执行
而且我们这边捕捉到这个崩溃发生前 用户并没有返回 一直停留在这个播放的界面 只是一直在拖拽进度条 播放 暂停 最小化到后台 再返回前台

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

2017-06-08 16:46:22.257842+0800 KGMAT[2811:939942] [DYMTLInitPlatform] platform initialization successful
2017-06-08 16:46:22.860411+0800 KGMAT[2811:939795] BTGAspects: Unable to find selector -[NSURLSessionConfiguration setProtocolClasses:].
2017-06-08 16:46:22.970470+0800 KGMAT[2811:939952] PBItemCollectionServicer connection disconnected.
2017-06-08:16:46:22:970 -QQAPI- ConfigManager.m:113 @_@
2017-06-08 16:46:23.241619+0800 KGMAT[2811:939795] *** -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL
2017-06-08 16:46:23.247773+0800 KGMAT[2811:939795] *** -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL
2017-06-08 16:46:23.411030+0800 KGMAT[2811:939795] *** -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL
2017-06-08 16:46:23.861220+0800 KGMAT[2811:939795] BUGTAGS: Bugtags v2.3.0(0510) started successfully
2017-06-08 16:46:28.925429+0800 KGMAT[2811:939951] Metal GPU Frame Capture Enabled
2017-06-08 16:46:28.926425+0800 KGMAT[2811:939951] Metal API Validation Enabled
2017-06-08 16:46:29.030286+0800 KGMAT[2811:939951] libMobileGestalt MobileGestaltSupport.m:153: pid 2811 (KGMAT) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2017-06-08 16:46:29.030320+0800 KGMAT[2811:939951] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see rdar://problem/11744455)
2017-06-08 16:46:29.128810+0800 KGMAT[2811:939795] [PLV_SDK_INFO] 播放在线视频,自动。
2017-06-08 16:46:34.647859+0800 KGMAT[2811:939795] [PLV_SDK_INFO] 切换码率为:超清。
2017-06-08 16:46:38.093232+0800 KGMAT[2811:939795] [PLV_SDK_INFO] 切换码率为:自动。
2017-06-08 16:46:41.179291+0800 KGMAT[2811:939795] [PLV_SDK_INFO] 切换码率为:流畅。
2017-06-08 16:46:49.397887+0800 KGMAT[2811:939795] [Playback] ❗️Failed to queue any items.
2017-06-08 16:46:49.414309+0800 KGMAT[2811:939795] [Playback] ❗️Failed to queue any items.
2017-06-08 16:46:49.853472+0800 KGMAT[2811:939982] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-06-08 16:46:49.855024+0800 KGMAT[2811:939982] [MC] Reading from public effective user settings.
2017-06-08 16:46:59.252932+0800 KGMAT[2811:940435] PBItemCollectionServicer connection disconnected.
2017-06-08 16:46:59.252959+0800 KGMAT[2811:940436] PBItemCollectionServicer connection disconnected.
2017-06-08 16:46:59.253084+0800 KGMAT[2811:940442] PBItemCollectionServicer connection disconnected.
2017-06-08 16:46:59.262943+0800 KGMAT[2811:939795] [Playback] ❗️Failed to queue any items.
2017-06-08 16:47:04.859504+0800 KGMAT[2811:939982] [MediaRemote] Error Operation requires a client callback to have been registered. requesting playback queue
2017-06-08 16:47:04.862191+0800 KGMAT[2811:939982] [MediaRemote] Error Operation requires a client callback to have been registered. requesting playback queue
2017-06-08 16:47:31.503944+0800 KGMAT[2811:939795] [Playback] ❗️Failed to queue any items.
2017-06-08 16:47:32.937266+0800 KGMAT[2811:940444] [MediaRemote] Error Operation requires a client callback to have been registered. requesting playback queue
2017-06-08 16:47:32.941103+0800 KGMAT[2811:940444] [MediaRemote] Error Operation requires a client callback to have been registered. requesting playback queue
2017-06-08 16:48:23.363005+0800 KGMAT[2811:941458] [hcln] 566: Entered
2017-06-08 16:48:23.967091+0800 KGMAT[2811:939795] 30: AudioSessionSilenceOutput2 is passing a serverPID of 0 to CheckRPCError!
2017-06-08 16:48:23.967213+0800 KGMAT[2811:939795] 30: AudioSessionSilenceOutput2 is passing a serverPID of 0 to CheckRPCError!
2017-06-08 16:48:24.029872+0800 KGMAT[2811:939795] [hcln] 23: (null): self.client.clientID != kInvalidClientID error -4871
2017-06-08 16:48:24.031717+0800 KGMAT[2811:939795] [Playback] ❗️Playback failed with error: Error Domain=AVFoundationErrorDomain Code=-11819 "无法完成操作" UserInfo={NSLocalizedDescription=无法完成操作, NSLocalizedRecoverySuggestion=请稍后再试。}, not resolving (canResolve: YES, errorResolver: (null))
2017-06-08 16:48:24.032474+0800 KGMAT[2811:939795] [Playback] ‼️ _serverConnectionDidDie
2017-06-08 16:48:24.038068+0800 KGMAT[2811:939795] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An AVPlayerItem cannot be associated with more than one instance of AVPlayer'
*** First throw call stack:
(0x1896d2fe0 0x188134538 0x19108a31c 0x1910771c0 0x1945d9f3c 0x1944c3c1c 0x1944c3278 0x1944c1a2c 0x194557ddc 0x1943fdf98 0x1943ff3d8 0x102021a50 0x102021a10 0x102026b78 0x1896810c8 0x18967ece4 0x1895aeda4 0x18b018074 0x18f869058 0x100285a74 0x1885bd59c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

这是完整的Xcode-Log 我刚才没有返回 只是在播放的界面 不停的拖拽进度条 不停的点击播放暂停 不停的最小化 在返回 最小化期间 试着打了一个电话 发了一条语音 看了一下别的视频 再回来 就会崩溃

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

(lldb) bt
KGMAT was compiled with optimization - stepping may behave oddly; variables may not be available.

thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001886cd014 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000188797264 libsystem_pthread.dylib`pthread_kill + 112
frame #2: 0x00000001886419c4 libsystem_c.dylib`abort + 140
frame #3: 0x000000018810d1b0 libc++abi.dylib`abort_message + 132
frame #4: 0x0000000188126c04 libc++abi.dylib`default_terminate_handler() + 304
frame #5: 0x0000000188134820 libobjc.A.dylib`_objc_terminate() + 124
frame #6: 0x00000001881235d4 libc++abi.dylib`std::__terminate(void (*)()) + 16
frame #7: 0x0000000188122ef8 libc++abi.dylib`__cxa_throw + 136
frame #8: 0x000000018813466c libobjc.A.dylib`objc_exception_throw + 364
frame #9: 0x000000019108a31c AVFoundation`-[AVPlayerItem _attachToPlayer:] + 332
frame #10: 0x00000001910771c0 AVFoundation`-[AVPlayer _insertItem:afterItem:] + 100
frame #11: 0x00000001945d9f3c MediaPlayer`-[MPQueuePlayer insertItem:afterItem:] + 68
frame #12: 0x00000001944c3c1c MediaPlayer`-[MPAVQueueCoordinator _syncPlayerItems] + 1876
frame #13: 0x00000001944c3278 MediaPlayer`-[MPAVQueueCoordinator _syncItemsWithPreviousItems:] + 1792
frame #14: 0x00000001944c1a2c MediaPlayer`-[MPAVQueueCoordinator reloadItemsKeepingCurrentItem:] + 1112
frame #15: 0x0000000194557ddc MediaPlayer`-[MPAVPlaylistManager connectPlayer] + 676
frame #16: 0x00000001943fdf98 MediaPlayer`-[MPAVController _connectAVPlayer] + 188
frame #17: 0x00000001943ff3d8 MediaPlayer`__42-[MPAVController _serverConnectionDidDie:]_block_invoke + 52
frame #18: 0x0000000102021a50 libdispatch.dylib`_dispatch_call_block_and_release + 24
frame #19: 0x0000000102021a10 libdispatch.dylib`_dispatch_client_callout + 16
frame #20: 0x0000000102026b78 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1204
frame #21: 0x00000001896810c8 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
frame #22: 0x000000018967ece4 CoreFoundation`__CFRunLoopRun + 1572
frame #23: 0x00000001895aeda4 CoreFoundation`CFRunLoopRunSpecific + 424
frame #24: 0x000000018b018074 GraphicsServices`GSEventRunModal + 100
frame #25: 0x000000018f869058 UIKit`UIApplicationMain + 208
frame #26: 0x0000000100285a74 KGMAT`main(argc=<unavailable>, argv=<unavailable>) at main.m:13 [opt]
frame #27: 0x00000001885bd59c libdyld.dylib`start + 4

(lldb)

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

我跑一下你们的Demo 试试

@ConnyYue
Copy link

ConnyYue commented Jun 8, 2017

经测试 Demo也会崩溃 稍后我会发截图~

@sunlei4076
Copy link

sunlei4076 commented Jun 15, 2017

解决了吗 这边也是一直存在
按照http://codecloud.net/22089.html这个方法 崩溃减少了
但是现在依然会有崩溃

2017-06-15 18 33 10

@ConnyYue
Copy link

应该还没解决 上周客服说它们重现不了 我给客服发过崩溃的操作视频 崩溃的问题还没有反馈结果 @sunlei4076

@sunlei4076
Copy link

2017-06-25 12 18 57

版本(Jun 19, 2017) 依然存在

@ConnyYue
Copy link

我司已经在考虑更换SDK了 牵扯到的比较多 暂时还没有具体的方案
@sunlei4076 如果你们还没有深入的使用 尽早考虑考虑吧

@bqlin
Copy link
Collaborator

bqlin commented Jul 17, 2017

可以试试最新的release版本,polyv-ios-client-demo release v1.4.0,对应的是 dev 分支的最新代码。该版本使用 AVPlayer 改写了原来使用的播放器,看能不能解决你的问题。

@bqlin bqlin closed this as completed Jul 25, 2017
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

4 participants