Info
Adform Video component ensures proper performance of Adform Video Banners.
Public Methods
There are several public methods that can be used with video player instance.
setVideoSource
Events
- Value: 'adformVideoEventPlay'
- Description: Whenever video source starts to play.
AdformVideoEvent.STOP
- Value: 'adformVideoEventStop'
- Description: Whenever video source stops.
AdformVideoEvent.PAUSE
- Value: 'adformVideoEventPause'
- Description: Whenever video source starts to pauses.
AdformVideoEvent.LOAD_COMPLETE
- Value: 'adformVideoEventLoadComplete'
- Description: Dispatched when video has loaded successfully.
AdformVideoEvent.LOAD_PROGRESS
- Value: 'adformVideoEventLoadProgress'
- Description: Dispatched when data is received as the download operation progresses.
AdformVideoEvent.PLAY_PROGRESS
- Value: 'adformVideoEventPlayProgress'
- Description: Dispatched when video playing operation progresses.
AdformVideoEvent.START_SEEK
- Value: 'adformVideoEventStartSeek'
- Description: Dispatched when video has been started to seek.
AdformVideoEvent.END_SEEK
- Value: 'adformVideoEventEndSeek'
- Description: Dispatched when video has been stoped to seek.
AdformVideoEvent.COMPLETE
- Value: 'adformVideoEventComplete'
- Description: Dispatched when video has played successfully till the end.
AdformVideoEvent.ON_CUE_POINT
- Value: 'adformVideoEventOnCuePoint'
- Description: Invoked when an embedded cue point is reached while playing a video file.
AdformVideoEvent.ON_META_DATA
- Value: 'adformVideoEventOnMetaData'
- Description: Dispatched when the application receives descriptive information embedded in the video being played.
AdformVideoEvent.SOUND_ON
- Value: 'adformVideoEventSoundOn'
- Description: Whenever sound button has been toggled on.
AdformVideoEvent.SOUND_OFF
- Value: 'adformVideoEventSoundOff'
- Description: Whenever sound button has been toggled off.
AdformVideoEvent.FULL_SCREEN_ON
- Value: 'adformVideoEventFullScreenOn'
- Description: Whenever video enters video fullscreen mode.
AdformVideoEvent.FULL_SCREEN_OFF
- Value: 'adformVideoEventFullScreenOff'
- Description: Whenever video leaves video fullscreen mode.
AdformVideoEvent.NET_CONNECTION_STATUS
- Value: 'adformVideoEventNetConnectionStatus'
- Description: Whenever video net connection status changes (can be used only with streaming videos).
AdformVideoEvent.SWITCH_VIDEO_SOURCE
- Value: 'adformVideoEventSwitchVideoSource'
- Description: Whenever video source was switched.
AdformVideoEvent.SET_VOLUME
- Value: 'adformVideoEventSetVolume'
-
Description: This event is used to control volume of a video player. Also
volumeproperty must be set in the event constructor.
Examples
ActionScript2
Example 1:
import com.adform.events.AdformEventDispatcher;
import com.adform.events.AdformVideoEvent;
//event listener
AdformEventDispatcher.addAdformEventListener(AdformVideoEvent.PLAY, eventHandler);
function eventHandler(eObj:Object):Void
{
// custom code
}
//event dispatch
this.btn.onRelease = function() : Void{
AdformEventDispatcher.dispatchAdformEvent({type:AdformVideoEvent.PLAY, targetsArr:["adformVideoPlayer"]});
}
Example 2:
import com.adform.events.AdformEventDispatcher;
import com.adform.events.AdformVideoEvent;
AdformEventDispatcher.addAdformEventListener(AdformVideoEvent.PLAY, callback);
AdformEventDispatcher.addAdformEventListener(AdformVideoEvent.ON_META_DATA, callback);
function callback(event:Object):Void {
var response:String = '';
switch (event.type) {
case AdformVideoEvent.PLAY:
response = 'Playing Video';
break;
case AdformVideoEvent.ON_META_DATA:
response = 'Metadata event: framerate: ' + eventObj.metaDataObj.framerate + ' fps.';
break;
}
trace(response);
}
ActionScript3
Example 1:
import com.adform.events.AdformEventDispatcher;
import com.adform.events.AdformVideoEvent;
//event listener
AdformEventDispatcher.addAdformEventListener(AdformVideoEvent.PLAY, eventHandler);
function eventHandler(eObj:AdformVideoEvent):void
{
// custom code
}
//event dispatch
btn.addEventListener(MouseEvent.CLICK, playButtonClick);
function playButtonClick(e:MouseEvent):void{
AdformEventDispatcher.dispatchAdformEvent(new AdformVideoEvent(AdformVideoEvent.PLAY,["adformVideoPlayer"]));
}
Example 2:
import com.adform.events.AdformEventDispatcher;
import com.adform.events.AdformVideoEvent;
AdformEventDispatcher.addAdformEventListener(AdformVideoEvent.PLAY, callback);
AdformEventDispatcher.addAdformEventListener(AdformVideoEvent.ON_META_DATA, callback);
function callback(event:AdformVideoEvent):void {
var response:String = '';
switch (event.type) {
case AdformVideoEvent.PLAY:
response = 'Playing Video';
break;
case AdformVideoEvent.ON_META_DATA:
response = 'Metadata event: framerate: ' + event.metaDataObj.framerate + ' fps.';
break;
}
trace(response);
}
Video Event Object
AdformVideoEvent object is passed with every video event and depending of its type may have the following properties.

{event}.cuePointObj Object

{event}.metaDataObj Object

{event}.netConnectionObj Object

Video Componets Inspector Properties
Video Controls (adformVideoPlayButton, adformVideoSeekBar, etc.)

Video Controls (adformVideoPlayButton, adformVideoSeekBar, etc.)

settings.xml
Example
<root>
<assets>
<asset id="1" bitrate="530" bwsource="0" source="rtmp://yourserver.com/cbr/video-530.flv" />
<asset id="2" bitrate="498" bwsource="1" source="rtmp://yourserver.com/cbr/video-498.flv" />
<asset id="3" bitrate="372" bwsource="1" source="rtmp://yourserver.com/cbr/video-372.flv" />
<asset id="4" bitrate="718" bwsource="1" source="rtmp://yourserver.com/cbr/video-718.flv" />
<asset id="5" bitrate="950" bwsource="0" source="rtmp://yourserver.com/cbr/video-950.flv" />
<asset id="6" bitrate="1255" bwsource="5" source="rtmp://yourserver.com/cbr/video-1255.flv" />
<asset id="7" bitrate="0" bwsource="0" source="http://www.yourserver.com/other_video.flv" />
</assets>
</root>
Weight
ActionScript2:
adformVideoPlayer – 17095 bytes;
ActionScript3:
adformVideoPlayer – 19076 bytes;