MobileVLCKit 播放器在 iOS 11 上显示黑屏

MobileVLCKit player shows black screen on iOS 11

在我的项目中使用 MobileVLCKit 3.0.0 播放媒体。

所有类型的视频在iOS9&10上播放成功但是在iOS11上视频音频能听但是画面不显示黑屏.

给出以下日志:

2017-09-18 18:26:17.640065+0800 DemoPlayer[39923:369260] creating player instance using shared library
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 39923, TID: 369593, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   DemoPlayer                          0x0000000108349895 Open + 405
2017-09-18 18:26:23.490963+0800 DemoPlayer[39923:369593] [reports] Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 39923, TID: 369593, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   DemoPlayer                          0x0000000108349895 Open + 405
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView initWithFrame:]
PID: 39923, TID: 369593, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   DemoPlayer                          0x0000000108349f3b -[VLCOpenGLES2VideoView initWithFrame:zeroCopy:voutDisplay:] + 91
2017-09-18 18:26:23.875359+0800 DemoPlayer[39923:369593] [reports] Main Thread Checker: UI API called on a background thread: -[UIView initWithFrame:]
PID: 39923, TID: 369593, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   DemoPlayer                          0x0000000108349f3b -[VLCOpenGLES2VideoView initWithFrame:zeroCopy:voutDisplay:] + 91
2017-09-18 18:26:23.959355+0800 DemoPlayer[39923:369593] CoreAnimation: [EAGLContext renderbufferStorage:fromDrawable:] was called from a non-main thread in an implicit transaction! Note that this may be unsafe without an explicit CATransaction or a call to [CATransaction flush].
shader program 1: WARNING: Output of vertex shader 'TexCoord1' not read by fragment shader
WARNING: Output of vertex shader 'TexCoord2' not read by fragment shader

提前致谢。

您需要将 MobileVLCKit 更新到版本“3.0.0a38”或更高版本的 pod 'MobileVLCKit-unstable'。此问题已解决。没有办法让旧版本的库以任何方式工作,因为它从后台线程调用 UIKit。

终于找到解决办法了...

现在 'MobileVLCKit-Unstable' 版本已于 9 月 20 日更新为主版本,使用来自后台线程的 UIKit(iOS 11 视频播放)问题。

解决方案1:

pod 'MobileVLCKit-unstable', '3.0.0a38' 添加到 podfile 和 运行 pod install

解决方案 2:

  1. 从以下 URL 克隆了存储库:http://code.videolan.org/videolan/VLCKit.git

  2. 打开终端,导航到根目录并执行./buildMobileVLCKit.sh -f(注意:可能需要1-2小时才能完成)

  3. 成功完成后,MobileVLCKit.framework 将在 VLCKit/build/ 文件夹位置生成。
  4. 只需将其拖到您的项目中即可。