cocos2d-x ios 11.3 播放Mp4 ccexp.VideoPlayer黑屏或者跳过

发现cocos2d-x 引擎在ios 11.3上播放视频会黑屏并且直接跳过

两种解决办法,升级引擎到3.16版本之后

或者修改Oc的代码

在UIVideoPlayer-ios.mm下

-(void) videoFinished:(NSNotification *)notification
{
    if(_videoPlayer != nullptr)
    {
        //fix : ios 11.3 sends wrong notificaiton here, we need to ignore it
        if ([self.moviePlayer playbackState] == MPMoviePlaybackStatePlaying)
        {
            return;
        }
        if([self.moviePlayer playbackState] != MPMoviePlaybackStateStopped)
        {
            _videoPlayer->onPlayEvent((int)VideoPlayer::EventType::COMPLETED);
        }
    }
}

就好啦!

你可能感兴趣的:(cocos2d-x,lua,cocos2d-x,C++)