Example 2.13.00 - Rescheduling with the original playlist



The configuration for this example is:


<script>
function createOVAConfig(adPosition) {
    var config = {
       debug: { levels: "fatal, config, vast_template, playlist, http_calls, tracking_events" },
       ads: {
          servers: [
             {
                type: "OpenX",
                apiAddress: "OVA_OPENX_API"
             }
          ],
          notice: { textStyle: "smalltext" },
          schedule: [
             {
                zone: "18",
                position: adPosition
             }
          ]
       }
    };
    return config;
}

function rescheduleWithAdPosition(position) {
	if($f().getPlugin('ova').scheduleAds(null, createOVAConfig(position))) {
		debug("OVA successfully rescheduled with " + position + " ad positions using the original playlist");
	}
	else {
		debug("OVA failed to reschedule with " + position +  " ad positions using the original playlist");
	}
}

flowplayer("a.example", "", {
    playlist: [
        { 
            url: "http://streaming.openvideoads.org/shows/bbb-640x360.mp4",
            duration: 10,
            autoplay: false 
        },
        { 
            url: "http://streaming.openvideoads.org/shows/sintel-1024-stereo.mp4",
            duration: 11 
        }
    ],

    plugins: {	    
        controls: {
            autoHide: "always"
        },

        ova: {
            url: "",

            "ads": {
                 "servers": [
                     {
                          "type": "OpenX",
                          "apiAddress": "",
                     }
                 ],
                 "notice": { "textStyle": "smalltext" },
                 "schedule": [
                       {
                           "zone": "5",
                           "position": "pre-roll"
                       }
                 ]
            },

            "debug": {
                 "levels": ""
            }
        }
    }
});
</script>

<ul>
  <li><a href="#" onclick="$f().getPlugin("ova").setActiveLinearAdVolume(0);">
    Mute ad
  </a></li>
  <li><a href="#" onclick="$f().getPlugin("ova").setActiveLinearAdVolume(50);">
     Middle volume
  </a></li>
  <li><a href="#" onclick="$f().getPlugin("ova").setActiveLinearAdVolume(100);">
    Maximum volume
  </a></li>
</ul>