我正在尝试使用Fluid Player将preRoll广告添加到我的内容视频中。
根据文档,我必须:
这是我所做的:
HTML + JS代码
<html>
<head>
<title>Fluid Player</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.fluidplayer.com/v2/current/fluidplayer.min.css" type="text/css"/>
<script src="https://cdn.fluidplayer.com/v2/current/fluidplayer.min.js"></script>
</head>
<body>
<video id='my-video'>
<source src='https://my.domain.com/video/sample.mp4' type='video/mp4'/>
</video>
<script type="text/javascript">
fluidPlayer('my-video', {
layoutControls: {
playButtonShowing: false,
autoPlay: false,
mute: false,
keyboardControl: false,
fillToContainer: true,
controlBar: {
autoHide: false, // Default false
},
vastOptions: {
vastTimeout: 5000,
adText: 'advertisement',
adList: [
{
roll: 'preRoll',
vastTag: 'https://my.domain.com/xml/vastLinear.xml'
}
]
}
}
});
</script>
</body>
</html>
VAST xml
<?xml version="1.0" encoding="UTF-8"?>
<VAST version="3.0">
<Ad id="1">
<InLine>
<AdSystem>Example</AdSystem>
<AdTitle/>
<Impression id="example"><![CDATA[http://example.com/view?tracking_event=impression&idzone=9999999]]></Impression>
<Impression id="example2"><![CDATA[http://example.com/view2?tracking_event=impression&idzone=9999999]]></Impression>
<Creatives>
<Creative sequence="1" id="1">
<Linear skipoffset="00:00:03">
<TrackingEvents>
<Tracking event="progress" offset="00:00:01.000"><![CDATA[http://example.com/view?tracking_event=progress&progress=00:00:01.000&idzone=9999999]]></Tracking>
<Tracking event="progress" offset="00:00:02.000"><![CDATA[http://example.com/view?tracking_event=progress&progress=00:00:02.000&idzone=9999999]]></Tracking>
<Tracking event="progress" offset="00:00:05.000"><![CDATA[http://example.com/view?tracking_event=progress&progress=00:00:05.000&idzone=9999999]]></Tracking>
<Tracking event="progress" offset="00:00:05.000"><![CDATA[http://example.com/view2?tracking_event=progress&progress=00:00:05.000&idzone=9999999]]></Tracking>
<Tracking event="progress" offset="00:00:09.000"><![CDATA[http://example.com/view?tracking_event=progress&progress=00:00:09.000&idzone=9999999]]></Tracking>
<Tracking event="start"><![CDATA[http://example.com/view?tracking_event=start&idzone=9999999]]></Tracking>
<Tracking event="firstQuartile"><![CDATA[http://example.com/view?tracking_event=firstQuartile&idzone=9999999]]></Tracking>
<Tracking event="midpoint"><![CDATA[http://example.com/view?tracking_event=midpoint&idzone=9999999]]></Tracking>
<Tracking event="midpoint"><![CDATA[http://example.com/view2?tracking_event=midpoint&idzone=9999999]]></Tracking>
<Tracking event="midpoint"><![CDATA[http://example.com/view3?tracking_event=midpoint&idzone=9999999]]></Tracking>
<Tracking event="thirdQuartile"><![CDATA[http://example.com/view?tracking_event=thirdQuartile&idzone=9999999]]></Tracking>
<Tracking event="complete"><![CDATA[http://example.com/view?tracking_event=complete&idzone=9999999]]></Tracking>
</TrackingEvents>
<VideoClicks>
<ClickThrough><![CDATA[http://example.com/]]></ClickThrough>
<ClickTracking><![CDATA[http://example.com/view?tracking_event=click&idzone=9999999]]></ClickTracking>
<ClickTracking><![CDATA[http://example.com/view2?tracking_event=click&idzone=9999999]]></ClickTracking>
</VideoClicks>
<MediaFiles>
<MediaFile delivery="progressive" type="video/mp4"><![CDATA[http://my.domain.com/videos/pre-ad.mp4]]></MediaFile>
</MediaFiles>
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>
播放器可以很好地加载sample.mp4,但我看不到广告,也没有尝试在“网络”标签上获取VAST文件。
我想念什么?