Open zackOta opened 4 years ago
目前你可以把videoCycleOnce改成false就可以了,因为循不循环也没什么影响,主要因为XHLaunchAd.m的335行添加了AVPlayerItemDidPlayToEndTimeNotification的监听通知,只要你项目里其他地方用到了AVPlayer,播放完毕这里都会走监听里的方法,所以他的这段代码是有问题的,我是把这段代码注释了,然后在_adVideoView中也放弃了AVPlayerItemDidPlayToEndTimeNotification,采用addPeriodicTimeObserverForInterval的方式监听播放器的进度就可以了
我的代码 XHLaunchAd.setLaunch(SourceType.launchScreen) let videoAdconfiguration:XHLaunchVideoAdConfiguration = XHLaunchVideoAdConfiguration.default() videoAdconfiguration.duration = 12 videoAdconfiguration.videoCycleOnce = true videoAdconfiguration.videoNameOrURLString = "launchVideo.mp4" videoAdconfiguration.skipButtonType = .none XHLaunchAd.videoAd(with: videoAdconfiguration, delegate: self) 以上这段代码在didFinishLaunchingWithOptions中调用