Midroll video Ad example

Midroll video through videojs with Nuevo plugin

Built-in Nuevo plugin's direct video ad system (vroll) allows to play preroll, midroll and postroll videos. Midroll video is the most advanced part of the video ad system. You can play multiple midroll videos at any time position. You can play midroll videos one after another. You can order to play the midroll video at any time position using seconds or percent of main video duration.

The example above make use of 3 midroll videos. First starts at 00:10 with 5 second skip option, then followed by next midroll and 8 second skip option. Third non-skippable midroll starts at 50% of main video duration.
See the code tutorial as used in the example above.
Code snippet
<script>
   var player=videojs('player_1');
   player.nuevo({
	option1: value1, option2: value2
   })
   player.vroll([
     { 
        src: "https://path-to-midroll_1.mp4",
        type:"video/mp4", 
	href: "url-to-go-on-midroll-click",
        offset:"10",
        skip:"5",
        id:"6"
     }, {
       src: "https://path-to-midroll_2.mp4",
       type:"video/mp4",
       href: "url-to-go-on-midroll-click",
       offset:"10",
       skip:"8",
       id:"9"
     }, {
        src: "https://path-to-midroll_3.mp4",
	type:"video/mp4",
	href: "url-to-go-on-midroll-click",
	offset:"50%",
	id:"10"
     }
  ]);
</script>

How to track midroll playback and click

Just use javascript and simple function like:
Code snippet
<script>
   player.on('vroll', function(event, data) {
	var midroll_id = data.id;
	var action = data.action;
   });
</script>