6

I'm trying to integrate adocean into my Html5 video player to play ads. Here is my code which I wrote from adocean official documentation.I'm getting xml link from ado object. This XML contains the video SRC (campaign creative, which was created from admin panel), but weirdly I couldn't find a way to play the ad. Any ideas? I have also a Cross-Origin warning message in the console.

<!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>
avocadoLambda
  • 1,332
  • 7
  • 16
  • 33
Saba Shavidze
  • 604
  • 4
  • 14

0 Answers0