我对IOS上的播放器有问题。我使用VMediaPlayer (Vitamio)播放mp4文件和HLS流。在iOS10和更低版本上运行良好,但在iOS11中我没有视频,只有声音。
这是我的代码:
if (!mMPlayer) {
mMPlayer = [VMediaPlayer sharedInstance];
[mMPlayer setupPlayerWithCarrierView:self.videoCanvas withDelegate:self];
[mMPlayer setBufferSize:512*1024];
[mMPlayer setVideoQuality:VMVideoQualityHigh];
[mMPlayer setVolume:1.0f];
}
NSURL *videoURL = [ [ NSURL alloc ] initWithString: self.videoURL ];
[mMPlayer setDataSource:videoURL header:nil];
NSArray *key = @[@"-rtmp_live"];
NSArray *val = @[@"-1"];
[mMPlayer setOptionsWithKeys:key withValues:val];
[mMPlayer prepareAsync];
[player start];发布于 2018-01-10 19:08:26
GitHub上有一个关于你的确切问题的问题:
https://github.com/yixia/Vitamio-iOS/issues/58
到目前为止还没有解决方案,一个用户建议切换到另一个播放器,如ijkplayer
发布于 2019-11-06 15:15:11
您可以使用此解决方法。
mMPlayer.setVideoShown(false)
mMPlayer.setVideoShown(true)https://stackoverflow.com/questions/48185912
复制相似问题