原文:Five ways to make your app video-ad friendly
允许视频数据预拉取缓存(Load ads well in advance to permit buffering)
The moment you load a video ad, behind the scenes the ad starts buffering (essentially pre-loading) the video
开始加载一个视频广告,仅仅是视频资源开始启动资源加载和缓存,所以the network is the bottleneck
。在用户无感知的前提下,触发加载视频广告,在一定的缓存数据量后再展示广告,用户体验更好
Load your ad at least 15 seconds in advance of showing it
对于广告加载的超时时长或者提前预拉的时间间隔可做参考
及时释放无效广告(Free unused ads)
场景例子:加载了激励视频广告,但用户拒绝了观看,及时释放该广告。(内存、视频解码器…)
On Android, we recommend you null your reference to the ad, and if you’re using native ads, call
UnifiedNativeAd.destroy()
on the main thread. On iOS, set your reference to nil.
Android 推荐将广告引用置空,如果是调用原生广告,需要在住线程调用UnifiedNativeAd.destroy()
;iOS则是将引用置 nil。
避免加载多个广告(Avoid loading multiple concurrent ads)
Every phone has a limit to the number of videos it can hold in a prepared state.
在这个大前提下,仅加载你需要的广告,以获得最好的成功曝光体验。
在广告loaded回调后再展示广告(Don’t show an ad before receiving a notification that it has loaded)
GMA SDK通过通知notifications同步视频广告的加载及播放状态。
On Android, this notification arrives through AdListener.onAdLoaded().
在播放视频广告前释放应用自身的视频资源(Be extra cautious combining video ads with video content)
内存中避免同时加载着多个视频资源(不管都是视频广告还是应用内的视频内容)。