我正在尝试将adocean集成到我的 Html5 视频播放器中来播放广告。这是我从 adocean 官方文档中编写的代码。我正在 从 ado object 获取 xml 链接。此 XML 包含视频 SRC(从管理面板创建的广告系列广告素材),但奇怪的是我找不到播放广告的方法。有任何想法吗?我在控制台中也有一个跨域警告消息。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ado</title>
<script type="text/javascript" src="//port80ge.adocean.pl/files/js/ado.js">
</script>
<script type="text/javascript" >
/* (c)AdOcean 2003-2020 */
if(typeof ado!=="object"){ado={};ado.config=ado.preview=ado.placement=ado.master=ado.slave=function(){};}
ado.config({mode: "new", xml: false, consent: true, characterEncoding: false});
console.log("ado",ado)
ado.preview({enabled: true});
</script>
</head>
<body>
<video
id="pSw7GgCkOHRk9cOQs7QRtqsYodMzuEdaWtPajlcRyjf.y7"
playsinline
class="op-player__media"
autoplay
width="320"
height="240"
controls
>
<source src="./assets/Arya Kills The Night King (Alternative Version).mp4" />
</video>
<script type="text/javascript">
ado.master({id: 'pSw7GgCkOHRk9cOQs7QRtqsYodMzuEdaWtPajlcRyjf.y7', crossOrigin:"" ,contentType:'xml', server: 'port80ge.adocean.pl' });
console.log("adoo = ", ado);
</script>
</body>
</html>