Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3

...

Summary

Frequency's Javascript video player is built as an end all solution for short form video to support a myriad of third party players, media formats, advertising requirements, financial settlements, and reporting. This document describes the technical capabilities of the player. 

Player can be loaded as html from https://static.frequency.com/player/<version>/index.html or as standalone js file http://static.frequency.com/player/<version>/_assets/interface.js

PlayerLite can be downloaded as javaScript file from https://static.frequency.com/player/<version>/_assets/playerLite.js

Conviva builds can be found using <version>_conviva

Version History

Version #DescriptionRelease Date
3.0.12

Changes:

  • fix IE11 playhead issues
April 23, 2018
3.0.11

Changes:

  • fix safari problems with autoplay and mute
February 21, 2018
3.0.10

Changes:

  • fix safari problems with autoplay and mute
  • conviva postfix dropped
February 12, 2018
3.0.9

Changes:

  • conviva parameters in constructor
November 7, 2017
3.0.8

Changes:

  • fix Promises on legacy IE browsers
November 2, 2017
3.0.7

Changes

  • Fixed issue where onprogress event was sent after ended event
  • buffering fix

 

October 27, 2017
3.0.5

Changes

  • Added a work around for fetch commands when a browser does support it natively
  • Enhanced error management to ignore undefined errors so they are not returned in the OnError event

 

October 27, 2017
3.0.2

Changes

  • Remove testrunner

 

October 23, 2017
3.0.0

Changes:

  • New method for loading channels feed
  • New method for loading video

Breaking changes:

  • loadVideo method and video object constructor expecting video_id string instead of object
September 5, 2017
2.2.0

Changes:

  • deprecated loadVideo method
  • additional controls elements
  • removed Dailymotion and Vimeo players

Bugfixes:

  • autoplay issue on ios
  • events memory leaks
September 1, 2017
2.1.2

Changes

  • Ad fixes
August 19, 2017
2.1.1

Changes

  • Ad fixes
July 19, 2017
2.1.0

Changes

  • support for VAST error trackers
  • support for DNT
  • support for forcing ad delivery protocol
  • maximum and minimum Ad resolution support
  • maximum and minimum bitrate Ad support
  • additional player controls UI
  • New events
    • onActivity
    • onAd

Bugfixes:

  • State PLAYING not received after SEEKING
  • Edge Incorrect handling for SEEKING status for some videos.
  • Video doesn't pause at starting playback
  • Watch10 request is sent after forwarding the video
  • Player doesn't playback picked video after advertising ends.
  • Memory leaks for advertisements
July 11, 2017
2.0.4

Bugfixes:

  • API url is not supported in constructor call
March 23, 2017
2.0.3

Bugfixes:

  • "autoplay" is ignored
  • playerLite memory leaks
  • VAST impression support
March 16, 2017
2.0.2

Bugfixes:

  • Player does not emit onVolumeChange event during playing ads 
  • Current time is not equal to Duration on video End 
  • Video doesn't pause at starting playback
  • Infinite SEEKING state after advertisement 
  • "autoplay" is ignored

Breaking changes:

  •  please provide source instead of source_id in video object for ads 
February 22, 2017


Browsers & Device Support

Frequency's player is supported on the following browsers and devices and platforms


Desktop BrowserEngineVersion
   
   
   

 

VersionMp4HLSYouTubeVimeoDailyMotion
IE10+YesNoYesYesNo
Edge13+YesYesYesYesYes
FF30+Yes41+YesYesYes
Chrome35+YesYesYesYesYes
Opera30+YesYesYesYesYes
Safari6.2+YesYesFlashYesFlash
Mobile OSVersionMp4HLSYouTubeVimeoDailyMotion
Android4.4+YesYesYesYesNo
iOS6.0+YesYesYesYesNo
Windows Phone8.1+YesNoYesYesYes

Players & Formats

The Frequency Javascript video player provides a Javascript class and a set of constructs that makes short form video playback with advertisement a simple task. The supported video formats are:

Class Documentation

Player Class

The Player class plays videos from HTML5 web apps. The Player supports advertisement playback and beaconing along with standalone video playback transparently. 

Param
Type
Description
elementString or DOMNodeNode selector or DOMNode the player will be inserted into.
optionsObjectFrequency.Player.Options object

Player Fields

 

 

Param

TypeDescriptionDefault
urlStringThe video file url.-
startPositionNumberThe video start position0
autoplayBooleanAutoplay the video after it is loaded.

false

 

hlsBooleanEnables MP4 HLS playerfalse
adConfigObjectFrequency.Player.AdsConfig object 

 

 

Player Constructor

...

Fullscreen API support

 The Frequency Javascript video player provides wrapper around Fullscreen API. Supported browsers:

Desktop BrowserVersion
IE11+
Edge12+
FF10+
Chrome15+
Opera15+
Safari5.1+
Mobile OSVersion
Android-
iOS-
Windows Phone 

Demo

Frequency Player Demo

 

Player flow diagram

 

Image Added

 

To operate correctly player requires connectivity to 3 additional services:

  • API
  • Ad decisioning server (DS)
  • 3rd party services for VAST events

 

During player initialisation player is checking if provided session is still valid by calling API:

Code Block
languagebash
titleSession verification
curl 'http://qa-lgi-api.frequency.com/api/2.0/auth/session' -H 'x-frequency-auth: bdd6c80b-5fb8-4957-b140-a0c26747e45b' -H 'x-frequency-deviceid: 58f67176-743f-d762' --compressed
Code Block
languagejs
titleSession response
{  
   "country":"PL",
   "user_agent":"Paw/3.1.7",
   "device_id":"58f67176-743f-d762",
   "token":{  
      "token_access":"bdd6c80b-5fb8-4957-b140-a0c26747e45b",
      "token_refresh":"0c6d9018-8f4a-483b-9e35-dd21f2715748",
      "roles":[  
         "ROLE_ANONYMOUS",
         "ROLE_USER"
      ]
   },
   "app_name":"telenet",
   "app_id":"6394703612760826080",
   "user_id":"6410435873178213705",
   "session_id":"035c2005-761a-4c85-a1f6-9e3640c743ea",
   "account_id":"6113878517855336672"
}

When session is valid player stores account_id for future DS calls and is ready to load video feed. This is done by executing one of the functions:

  • loadVideo
  • loadChannel
  • loadPlaylist

Example call looks like one below:

Code Block
languagebash
titleLoad channel videos
curl 'http://qa-lgi-api.frequency.com/api/2.0/channels/6341811119618533518/videos' -H 'x-frequency-auth: bdd6c80b-5fb8-4957-b140-a0c26747e45b' -H 'x-frequency-deviceid: 58f67176-743f-d762' --compressed
Code Block
languagejs
titleList of videos to play
{  
   "videos":[  
      {  
         "title":"Jeff Sessions Says U.S. May Use DNA Tests to Verify Family Relationships at Border",
         "description":"Attorney General Jeff Sessions may use DNA tests to verify the relationship between children and adults who cross the border illegally! Rob Smith (@robsmithonline) has all the details.",
         "resolution":"1280x720",
         "resolutions":null,
         "duration":59,
      events:    "source":"Veuer",
         "score":0,
         "channel":{  
    }        "title":"Veuer",
      (...)      "channel_id":"6341811119618533518",
            "image_url":"https://qa-freq-images.frequency.com/channel/1rbhzt34412fd16ps1zgrx35f/original/1rbhzt34412fd16ps1zgrx35f.jpg"
         }
); 

Constructs a Player object for video playback.

Parameters:

video - The Frequency.Player.Video object containing the video url, playback start position along with whether to auto play the video once loaded.

events - The Frequency.Player.Events object to bind playback event listeners.

Returns:

An initialized Player object.

Player Methods

play

Code Block
play()

Plays the currently loaded video.

Parameters:

None

Returns:

void

pause

Code Block
pause()

Pauses the currently playing video.

Parameters:

None

Returns:

void

seekTo

Code Block
seekTo(time:Number)

Seeks to a specified time in the video.

Parameters:

time - The time position (in seconds) in the video to jump to. 

Returns:

void

  

getDuration

Code Block
getDuration()

Returns the duration of the currently playing video in seconds.

Parameters:

None

Returns:

Number - The video duration in seconds.

getState

Code Block
getState()

Returns the video player's current play state.

Parameters:

None

Returns:

Number - The number representing the video playback state. (see video states).

getCurrentTime

Code Block
getCurrentTime()

Returns the lapsed time since the video start in seconds.

Parameters:

None

Returns:

Number - The lapsed video playback time in seconds.

loadVideo

Code Block
loadVideo(url:String [, options])

Loads the video url specified by the url string. This does not auto play the video. The onMediaReady event would need to be monitored along with a subsequent video play() method call to cause the loaded video to play.

Parameters:

url - The url of the video to load.

options - additional options (optional) eg. adsConfig (Frequency.Player.AdsConfig)

Returns:

void

addEventListener

Code Block
addEventListener(event:String, callback:String)

Adds a listener function for the specified event. 

Parameters:

event - The event to register for listening. (See Player events)

callback - The event handler method of code block.

Returns:

void 

removeEventListener

Code Block
removeEventListener(event:String, callback:String)

Removes a listener function for the specified event.

Parameters:

event - The listening event. (See Player events)

callback - The event handler method or code block.

Returns:

void

Player Video Class

Code Block
Frequency.Player.Options.Video

The Player Video class is a video data structure used for video player initialization along with video playback.

Player Ads Configuration

Code Block
Frequency.Player.AdsConfig

Fields

Param

Type

Description

adTagUrl

String

VAST document URL

adCuePoints

Number[]

array of cue points (seconds or "preroll", "postroll")

Player Events Class

Code Block
Frequency.Player.Events

The Player Events class defines all the events that listeners can register on.

Event

Type

Description

onError

Function

An error occurred.

onReady

Function

JS player ready for actions.

onMediaReady

Function

Media player ready.

onStateChange

Function

Player state has changed.

onProgress

Function

Players progress changed.

onVastEventFunctionVast Ad Event occurred.

Video Playback States

State

Value

Description

UNKNOWN

undefined

Player state is unknown, player setup process did not finished.

UNSTARTED

-1

Player media ready but pending play action.

ENDED

0

Player finished playback.

PLAYING

1

Player is currently playing a video.

PAUSED

2

Player paused.

BUFFERING

3

Player is buffering.

LOCKED

4

Player locked by internal action.

 

Code Examples

Initialization

The sequence to using the Frequency Javascript Player is as follows:

...

Code Block
var player = new Frequency.Player();

The player can be initialized with video and listener bindings so that it is one-shot ready to play or the player object can be constructed and setting the video to play and event listeners in subsequent method calls.   

...

,
         "video_id":"6415162182727646499",
         "content_partner_id":null,
         "image_url":"https://qa-freq-images.frequency.com/video/1p1gxhsswx8re1xi6lyzl1srs/original/1p1gxhsswx8re1xi6lyzl1srs.jpg",
         "media_url":"https://qa-freq-media.frequency.com/videos/6415162182727646499/C3VHmxAgS-G4.mp4",
         "media_type":"h264",
         "media_types":[  
            "h264",
            "hls"
         ],
         "deep_link":"frequency://video/6415162182727646499",
         "source_id":"video7316576222416856667",
         "source_url":"https://qa-freq-media.frequency.com/videos/6415162182727646499/1p1gxhsswx8re1xi6lyzl1srs.mp4",
         "meta_tags":null,
         "referrer_link":"http://www.frequency.com/video/jeff-sessions-says-u.s.-/6415162182727646499?cid=6341811119618533518",
         "ad_tag":null,
         "ad_cue_points":[  
            0
         ],
         "date_publish":"2018-06-20T11:09:00Z",
         "date_available":"2018-06-20T11:28:26Z",
         "date_expired":null,
         "last_updated":"2018-06-20T11:28:26Z"
      },
      ...
   ],
   "page":{  
      "page_id":null,
      "page_size":30,
      "page_offset":"1",
      "page_mark":null
   }
}

 

For selected video player is creating DS call to fetch ad info. Request contains:

  • video data
  • session data
  • counters object (see below)
  • additional ad parameters described in plugins section of player

Code Block
languagebash
titleDS ad call
curl 'http://qa-freq-ad-eu.frequency.com/2.1/ad_request' -H 'Content-Type: application/json; charset=utf-8' -H 'Accept: application/json' --data-binary '{"IMA":false,"session":{"account_id":"6113878517855336672","device_id":"58f67176-743f-d762","token_access":"bdd6c80b-5fb8-4957-b140-a0c26747e45b","user_id":"6410435873178213705"},"counters":{},"video":{"title":"Jeff Sessions Says U.S. May Use DNA Tests to Verify Family Relationships at Border","description":"Attorney General Jeff Sessions may use DNA tests to verify the relationship between children and adults who cross the border illegally! Rob Smith (@robsmithonline) has all the details.","resolution":"1280x720","resolutions":null,"duration":59,"source":"Veuer","score":0,"channel":{"title":"Veuer","channel_id":"6341811119618533518","image_url":"https://qa-freq-images.frequency.com/channel/1rbhzt34412fd16ps1zgrx35f/original/1rbhzt34412fd16ps1zgrx35f.jpg"},"video_id":"6415162182727646499","content_partner_id":null,"image_url":"https://qa-freq-images.frequency.com/video/1p1gxhsswx8re1xi6lyzl1srs/original/1p1gxhsswx8re1xi6lyzl1srs.jpg","media_url":"https://qa-freq-media.frequency.com/videos/6415162182727646499/C3VHmxAgS-G4.mp4","media_type":"h264","media_types":["h264","hls"],"deep_link":"frequency://video/6415162182727646499","source_id":"video7316576222416856667","source_url":"https://qa-freq-media.frequency.com/videos/6415162182727646499/1p1gxhsswx8re1xi6lyzl1srs.mp4","meta_tags":null,"referrer_link":"http://www.frequency.com/video/jeff-sessions-says-u.s.-/6415162182727646499?cid=6341811119618533518","ad_tag":null,"ad_cue_points":[0],"date_publish":"2018-06-20T11:09:00Z","date_available":"2018-06-20T11:28:26Z","date_expired":null,"last_updated":"2018-06-20T11:28:26Z"},"params":{"url":"//qa-freq-ad-eu.frequency.com","minBitrate":100,"maxBitrate":5000,"maxResolution":"720p","minResolution":"720p","deliveryProtocol":"https","format":"video/mp4","CHILD_DIRECTED_CONTENT":false},"device":{"DNT":1,"advertisingId":"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36","connectionType":"wifi","countryCode":"US","timeZone":-2,"locale":"en-US","language":"en","capability":["VPAID","VAST","MRAID"],"category":"desktop"},"application":{"name":"Web","domain":"com.frequency","storeLocation":"","bundle":"com.frequency.player-3.1"}}' --compressed

This will produce JSON containing ad data or empty response if ad should not be displayed (more below)

Code Block
languagejs
titleAd response
{
    "VAST":{
    "version":3,
        "ad":{
        "id":"94691571",
            "inLine":{
            "adSystem":"GDFP",
                "adTitle":"Mountain Dew NBA",
                "description":"Mountain Dew NBA ad",
                "error":[
                "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoplayfailed[ERRORCODE]"
            ],
                "impression":[
                "http://pubads.g.doubleclick.net/pcs/view?xai=AKAOjsvdVj_cxz0fwuQcC65H3U2j_GegtDEvbT_z_JWt2zrFC361C4AJM885ooCz66XTeOYJ28lg_SyEA7nDuK61IZWXsevp_8GpXHilXGR9wap0vrndyInz7zpGviqyfX6qBACXqu1GjJ4CroW1Kdc55dS981D_J4hC_ZMspaDhd3MYAVL_6BX2pNXXoXjxUybye0VFtNdw9eAOwqG0HtEX_gsLO1ZeTzjFiEccluIVOC4&sig=Cg0ArKJSzEscm6_-DknEEAE&adurl="
            ],
                "creatives":[
                {
                    "id":"107074364451",
                    "sequence":1,
                    "skipoffset":5,
                    "duration":30,
                    "trackingEvents":{
                        "start":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=part2viewed&ad_mt=[AD_MT]"
                        ],
                        "firstQuartile":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoplaytime25&ad_mt=[AD_MT]"
                        ],
                        "midpoint":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoplaytime50&ad_mt=[AD_MT]"
                        ],
                        "thirdQuartile":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoplaytime75&ad_mt=[AD_MT]"
                        ],
                        "complete":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoplaytime100&ad_mt=[AD_MT]"
                        ],
                        "mute":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=admute&ad_mt=[AD_MT]"
                        ],
                        "unmute":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adunmute&ad_mt=[AD_MT]"
                        ],
                        "rewind":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adrewind&ad_mt=[AD_MT]"
                        ],
                        "pause":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adpause&ad_mt=[AD_MT]"
                

...

        ],

...

                    

...

    "resume":[
                       

...

     "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adresume&ad_mt=[AD_MT]"
                        ],
                      

...

  "fullscreen":

...

[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adfullscreen&ad_mt=[AD_MT]"
                        ],
                      

...

  "creativeView":

...

[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=vast_creativeview&ad_mt=[AD_MT]"
                        ],
                      

...

  "exitFullscreen":[

...

                          

...

  "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=vast_exit_fullscreen&ad_mt=[AD_MT]"
                        ],
                        "acceptInvitationLinear":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=acceptinvitation&ad_mt=[AD_MT]"
                        ],
                        

...

"closeLinear":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adclose&ad_mt=[AD_MT]"
                        ],
                        "skip":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoskipped&ad_mt=[AD_MT]"
                        ],
                        "progress":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=video_skip_shown&ad_mt=[AD_MT]",
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=video_engaged_view&ad_mt=[AD_MT]"
                      

...

  ]
                    },
                   

...

 "adParameters":"deployment=devsite,sample_ct=skippablelinear",
                    "mediaFiles":[
                        {
                      

...

      "id":"GDFP",
                        

...

    "delivery":"progressive",
                      

...

      "width":"1280",
                            "height":"720",
                            "type":"video/mp4",
                            "bitrate":"1383",
                            "scalable":"true",
                            "maintainAspectRatio":"true",
                            "url":"http://redirector.gvt1.com/videoplayback/id/133827f22597d9ad/itag/22/source/gfp_video_ads/acao/yes/mime/video%2Fmp4/ip/0.0.0.0/ipbits/0/expire/1529520572/sparams/ip,ipbits,expire,id,itag,source,acao,mime/signature/64EFDDA91086C08874D6578EC67670819C6CFECC.08E71F290F6BA79E41C2E53A3F5E5838965D955F/key/ck2/file/file.mp4"
                        }

...


                    ],
                    "videoClicks":{
                        "clickThrough":"http://pubads.g.doubleclick.net/pcs/click?xai=AKAOjssrwKE5tRgppmtIua9Gbn5CFpK-fKKhsF9mc-YDeYK4Eycg3BShVD9mapIpOs4De5c7SSHPIVjD848DTHsiLNKEyH2hRFM8z1SQCRSsHXNTsUIvXSPGeiqldBZ3xRNV4ml3g-hibRWfaA7dAsMdAS2kem-rmkLaxMD7HAc_Kl_FLoBowTbJYLFX-Sz2ZXGssEDaHn4Fpc2SK3xvblW2h6fjZgiXxAF093q7&sig=Cg0ArKJSzHcKKy8z9YPN&adurl=http://www.frequency.com/"
                    }

...


                }
            ]
      

...

  

...

Add player event listeners.

Code Block
player.addEventListener(Frequency.Player.Events.onError, errorHandler);
player.addEventListener(Frequency.Player.Events.onProgress, progressHandler);

Play the video.

Code Block
player.loadVideo('http://videoURL.mp4);
player.play();

...

}
    }
}
}

 

All 3rd party trackers needs to be handled by player:

  • trackingEvents
  • impressions
  • errors (with appropriate error code)

More information about above trackers can be found in iAB VAST 3.0 specification 

 

Counters object - DS can serve advertisements with different frequencies depending on video source. Counters object contains information about already played videos and their sources. After playing video from above example next DS call should have:

Code Block
languagejs
titlecounters
counters:{
   Veuer: 1
}

 

When player finishes to play ad video playback starts. During the playback player needs to send following activities:

  • start
  • watch10 (after first 10 seconds of continues playback)
  • complete

 

Code Block
languagebash
titleActivity
// Sample calls for video activities
curl 'http://qa-lgi-api.frequency.com/api/2.0/activities/video/start' -H 'x-frequency-auth: bdd6c80b-5fb8-4957-b140-a0c26747e45b' -H 'content-type: application/json; charset=utf-8' -H 'accept: application/json' -H 'x-frequency-deviceid: 58f67176-743f-d762' --data-binary '{"video_id":"6415186034672079864"}' --compressed
 
curl 'http://qa-lgi-api.frequency.com/api/2.0/activities/video/watch10' -H 'x-frequency-auth: bdd6c80b-5fb8-4957-b140-a0c26747e45b' -H 'content-type: application/json; charset=utf-8' -H 'accept: application/json' -H 'x-frequency-deviceid: 58f67176-743f-d762' --data-binary '{"video_id":"6415186034672079864"}' --compressed
 
curl 'http://qa-lgi-api.frequency.com/api/2.0/activities/video/complete' -H 'x-frequency-auth: bdd6c80b-5fb8-4957-b140-a0c26747e45b' -H 'content-type: application/json; charset=utf-8' -H 'accept: application/json' -H 'x-frequency-deviceid: 58f67176-743f-d762' --data-binary '{"video_id":"6415186034672079864"}' --compressed