广告类型支持
不支持非线性广告播放,解析时直接报错:The provided ad type: nonlinear is not supported.
非线性广告仅在HTML5的版本支持。
代码研读
数据结构
Ad
包含了一个CreativeId,代表选中的主广告素材。
也就是一个Ad只能包含一个主广告素材(Linear or NonLinear)。如果有多个主广告素材,只有第一个会被选择,其他会被丢弃。
demo:one-ad-with-two-linear-creative.xml 在一个Ad中包含了两个线性素材,只有第一个会被选中,第二个直接丢弃,且不会报错。
同理,如果在一个Ad中包含了两个CompanionAds素材,只有第一个会被选中,第二个直接丢弃,且不会报错。demo:one-ad-with-two-companion-ads-creative.xml
仔细研读了一下VAST3.0的规范文档,发现Google的这个结构可能是会有问题的。
原文:
The <Creative> element may contain a sequence attribute that identifies the numerical order in which each creative should display. For example, an Ad may wish to play a Linear creative followed by a NonLinear creative. Values for the sequence attribute in this case would be 1 for the Linear creative and 2 for the NonLinear creative. Sequential display of creative in the absence of sequence values is at the video player’s discretion.
意思就是说<Creative>是可以有sequence属性的,如果有这个属性,就要按顺序播,理解下来就是主广告可能包含多个素材,而Google的这个Ad结构是不支持的。
使用adEvent.getAd().getCompanionAds()拿不到伴随广告的信息
然后伴随广告是可以正常渲染的,尚不确定是不是bug。