CoderZhuXH / XHLaunchAd

🔥The screen opening advertising solutions - 开屏广告、启动广告解决方案-支持静态/动态图片广告,mp4视频广告,全屏/半屏广告、兼容iPhone/iPad. 【 Github下载不了/下载慢 可以访问国内下载地址: https://gitee.com/CoderZhuXH/XHLaunchAd】

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

如何关闭十分钟log一次:video不循环,播放完成

zackOta opened this issue · comments

我的代码
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中调用

目前你可以把videoCycleOnce改成false就可以了,因为循不循环也没什么影响,主要因为XHLaunchAd.m的335行添加了AVPlayerItemDidPlayToEndTimeNotification的监听通知,只要你项目里其他地方用到了AVPlayer,播放完毕这里都会走监听里的方法,所以他的这段代码是有问题的,我是把这段代码注释了,然后在_adVideoView中也放弃了AVPlayerItemDidPlayToEndTimeNotification,采用addPeriodicTimeObserverForInterval的方式监听播放器的进度就可以了