-1

I'm trying set up Vasts in Videojs but can't make it work! My code looks like that. What i make wrong? The player works but does not display ads.

<html>
<head>
  <meta charset="UTF-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">
  <link href="https://vjs.zencdn.net/7.20.3/video-js.css" rel="stylesheet">
  <script src="https://vjs.zencdn.net/7.20.3/video.js"></script>
    <!-- videojs-vast-vpaid -->
  <link href="https://cdn.rawgit.com/MailOnline/videojs-vast-vpaid/master/bin/videojs.vast.vpaid.min.css" rel="stylesheet">
  <script src="https://cdn.rawgit.com/MailOnline/videojs-vast-vpaid/master/bin/videojs_5.vast.vpaid.min.js"></script>
  <script src="//cdn.sc.gl/videojs-hotkeys/latest/videojs.hotkeys.min.js"></script>
  
</head>


<body> 
<video id="videoPlayer" class="video-js vjs-default-skin vjs-big-play-centered" controls=""
data-setup='fluid:true {
 "plugins": {
         "vastClient": {
         "adTagUrl": "MY VAST TAG",
         "adsCancelTimeout": 3000,
         "adsEnabled": true,
         "preferredTech":"html5",
         "vpaidFlashLoaderPath": "https://github.com/MailOnline/videojs-vast-vpaid/blob/RELEASE/bin/VPAIDFlash.swf?raw=true"
     }
 }}'
poster="=" 
preload="auto"
width='593'
height='364'
>
<source src="/cdn3.viblast.com/streams/hls/airshow/playlist.m3u8" type="video/mp4">
</video>
</body>

1 Answers1

0

The value of your data-setup is not a valid JSON string, so the plugin would not be initialised. That said the Mailonline plugin has not been updated in many years and is unlikely to work with modern Video.js versions. You might have a better experience using something more up to date - e.g. https://github.com/googleads/videojs-ima

misterben
  • 7,455
  • 2
  • 26
  • 47
  • No, i can't use something more updated because i can't host the css and js of the newest updated plugins somewhere and from GitHub doesn't work – Anon Nonan Jan 20 '23 at 13:41