Widget message API

Widget message API provides access to Virool player events via native JavaScript callbacks. You might wish to handle these callbacks after your page has been loaded, or on demand. Please check out our examples to learn how to do so.

Just include our message API library on your page:

<script type='text/javascript' src='http://widget-assets.virool.com/assets/widget.messageapi.js'>

Now your page is ready to dispatch Virool player events:

ViroolWidget.on('playerReady', function() { });

Supported events

Event Description
playerReady Occurs when the video player has been loaded and the video is ready to be played. The auto-widget skips this event when there are no offers available to the visitor.
playbackStarted Occurs when visitor starts playback for the first time.
playbackPaused Occurs each time visitor pauses video playback.
playbackEnded Occurs when player ended video playback.
viewTracked Occurs when the user has watched enough to comply with our system requirements. However, this doesn’t guarentee that the site will be paid for because this view might not comply with other Virool filters. Only the HTTP(S) callback provides a 100% guarentee that the view has been added to the publisher's account.
noOffers Occurs when our system didn't find an offer for the current visitor.