FBAudienceNetwork:显示视频时FBMediaView冻结ui [英] FBAudienceNetwork : FBMediaView freeze ui when displaying video

查看:158
本文介绍了FBAudienceNetwork:显示视频时FBMediaView冻结ui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行此代码时,FbMediaView就像在主线程上加载广告视频一样,但是在显示图像时不会冻结.我不明白为什么?

When I do this code, the FbMediaView is like loading the ads video on the main thread but it's not freezing when displaying an image. I don't understand why ?

let nativeAd = self.adsManager.nextNativeAd()
    let cell : AdHomeCell? = self.collectionView!.dequeueReusableCellWithReuseIdentifier("AdHomeCell", forIndexPath: indexPath) as? AdHomeCell
    cell?.createForAd(nativeAd)
    nativeAd?.registerViewForInteraction(cell!, withViewController: self)
    return cell

我拥有最新的Facebook SDK(4.8.0)

I have the latest Facebook SDK (4.8.0)

推荐答案

Audience Network iOS SDK在内部使用AVFoundation播放视频广告.初始化AVAsset在主线程上做了很多工作.主线程处理iOS上的所有UI更新,因此会导致可见的暂停,尤其是在加载多个视频广告时.不使用私有API,就无法将工作卸载到其他线程.

The Audience Network iOS SDK uses AVFoundation internally to play video ads. Initializing an AVAsset does a lot of work on the main thread. The main thread handles all UI updates on iOS, so this results in visible pausing, particularly when loading multiple video ads. There is no way to offload that work to a different thread without using private API.

我们知道对性能的影响.我们正在v4.9中部署一些短期的改进,并且正在进行长期修复.目前,不建议在需要高滚动性能的某些应用中使用视频广告.

We're aware of the performance impact. We're deploying some short term marginal improvements in v4.9, and we're working on a long term fix. Right now, it is not recommended to use video ads in certain apps that need high levels of scrolling performance.

(我是Audience Network的软件工程师,并开发了iOS SDK.)

(I'm a software engineer on Audience Network, and develop the iOS SDK.)

这篇关于FBAudienceNetwork:显示视频时FBMediaView冻结ui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆