Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Inserting video after clicking nonlinear ad

6 replies [Last post]
Reply

Hi There,

I am currently working on a custom implementation ( as3.0 ) of OVA in a videoplayer. Everything is working fine.
JSON config is being parsed ok etc etc
i am using _vastCOntroller.streamSequence as the playlist.

The only thing is cant manage to get working is how to insert a video ad after you clicked a nonlinear ad. In this case a video from the streamsequence is alrdy playing....but how do i insert the new video and track this correctly... i use _vastController.adSchedule.getSlot( displayEvent.adSlotKey ); to get the adslot...... but how do i intergrate this in de shedule ?

Or is there another way to do it.. ?
I have read most docs but the only thing i can find on this subject is the example from flowplayer...

Any tips / help ?

thnx in advance
Rackdoll

Reply

So now what i do is just playing the stream i get back from the overlay click. But i get the feeeliung this is not good bec i dont get any click overlay or "this advertisement runs for x seconds".

Reply

Hi,

Yeh, this is one of the really hidden things in the framework.

The key thing to note is that you need to make a different call to pass in the timing events. The call has to tell the framework that the video playing is actually related to an overlay rather than the streams in the stream sequence.

The following code is in the OVA for JW5 plugin:

if(!_vastController.isActiveOverlayVideoPlaying()) {
_lastTimeTick = evt.position;
_vastController.processTimeEvent(getActiveStreamIndex(), new TimeEvent(evt.position * 1000, evt.duration));
}
else {
       _vastController.processOverlayLinearVideoAdTimeEvent(_activeOverlayAdSlotKey, new TimeEvent(evt.position * 1000, evt.duration));
}

The timing API to call when a linear ad relating to overlays are playing is "processOverlayLinearVideoAdTimeEvent" - instead of a stream index that call takes the index of the overlay in the Ad Schedule (_activeOverlayAdSlotKey in the code above).

The index of the active overlay ad slot can be grabbed out of the OverlayAdDisplayEvent that is passed when when the "overlay is clicked" listener is hit:

_vastController.addEventListener(OverlayAdDisplayEvent.CLICKED, onOverlayClicked);

public function onOverlayClicked(displayEvent:OverlayAdDisplayEvent):void {
    .... 
    _activeOverlayAdSlotKey = displayEvent.adSlotKey;
}

You also will notice in that code that there is a property "isActiveOverlayPlaying" on the VASTController. You need to set this to "true" when you load up the overlay related stream and start playing it, and then false when that stream stops playing.

Paul

Reply

Aha, so the _vastController.isActiveOverlayVideoPlaying()
does not auto go on true then i guess..
I have to manually set it to true ?
i traced this indd and it stays false; i could not find in your code where you set it to true...
Ok, so basicly:

i check if nonlinear ad is clicked....
then i get the slot key and set _vastController.isActiveOverlayVideoPlaying() to true....
then i play the stream and thus it will switch to overlayvideo ad render...
I wait till its done and then i set _vastController.isActiveOverlayVideoPlaying() to false again... and continue the stream i was playing ....

like this ? :)

Reply

yep - I looked at setting it automatically to "true", but the issue is that the OVA Framework doesn't actually play 'streams', so it never really know if that stream is playing, hence why it has to be set manually by the implementation loading up the overlay related stream.

Your flow is close (maybe I mis-understood one of the points) - just to be safe - it is this:

1. Check if non-linear ad clicked
2. Get the ad slot key from the OverlayAdDisplayEvent when the overlay is clicked
3. Set the VASTController.isActiveOverlayVideoPlaying to true
4. Load up the overlay linear ad stream and start playback
5. During overlay linear ad playback, in your code, switch to passing in the timing information via _vastController.processOverlayLinearVideoAdTimeEvent rather than _vastController.processTimeEvent
6. When done, set isActiveOverlayVideoPlaying to false

Paul

Reply

ait, k many thnx.
Seems pretty clear now.
Thats a big hurdle cleared up :D

thnx for the fast response.
am going to try to implement that. :)

cool framework btw.

Reply

works thnx a million!

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options