在使用PHP-Vast来测试VAST时出现错误,例如“广告错误:AdError 1012:由于网络错误而无法从服务器请求广告。” 在测试站点: https://developers.google.com/interactive-media-ads/docs/sdks/html5/vastinspector
XML生成结果:
<?xml version="1.0" encoding="utf-8"?>
<VAST version="2.0">
<Ad id="MyAdsVast">
<InLine>
<AdSystem>
<![CDATA[Ad Myads Vast]]>
</AdSystem>
<AdTitle>
<![CDATA[MyAds Video Vast]]>
</AdTitle>
<Impression id="imp1">
<![CDATA[http://example.com]]>
</Impression>
<Creatives>
<Creative>
<Linear>
<Duration>00:00:18</Duration>
<VideoClicks>
<ClickThrough>
<![CDATA[https://example.com/]]>
</ClickThrough>
<ClickTracking>
<![CDATA[https://example.com/]]>
</ClickTracking>
<CustomClick>
<![CDATA[https://example.com/]]>
</CustomClick>
</VideoClicks>
<TrackingEvents>
<Tracking event="start">
<![CDATA[https://example.com/]]>
</Tracking>
<Tracking event="pause">
<![CDATA[https://example.com/]]>
</Tracking>
</TrackingEvents>
<MediaFiles>
<MediaFile delivery="progressive" type="video/mp4" height="100" width="100" bitrate="2500">
<![CDATA[https://example.com/MyAds_Video1.mp4]]>
</MediaFile>
</MediaFiles>
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>
然后在根服务器(public_html)中创建crossdomain.xml
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" secure="false" />
</cross-domain-policy>
所有代码正常工作。请给我建议。谢谢