Page tree

Versions Compared

Key

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

...

Version #DescriptionRelease Date
3.0.612

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

...

Mobile OSVersion
Android-
iOS-
Windows PhoneIE Mobile 11+

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 Constructor

...

languagejs

...

 

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":[  
      {  
       minBitrate: 100,// kbps
        maxBitrate: 5000,// kbps  "title":"Jeff Sessions Says U.S. May Use DNA Tests to Verify Family Relationships at Border",
         maxResolution"description": '720p',
        minResolution: '720p',
        deliveryFormat: 'progressive',// progressive / streaming
		deliveryProtocol: 'https',// http / https
		format: 'video/mp4'
    },
	controls: { // boolean or object [default: false]
    	player: { // boolean or object [default: true]
			// css: 'sample-link-to--player.css'"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":{  
       },
		ads: { // boolean or object [default: true]
			// css: 'sample-link-to--adsplayer.css',     "title":"Veuer",
            "channel_id":"6341811119618533518",
            "image_url":"https://qa-freq-images.frequency.com/channel/1rbhzt34412fd16ps1zgrx35f/original/1rbhzt34412fd16ps1zgrx35f.jpg"
         },
  strings: { // optional 	   "video_id":"6415162182727646499",
        VIDEO "content_WILL_START_SOON: 'Keep calm and watch the ad, video will start in [time_left]s...'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",
      SKIP_AD: 'Skip'   "media_types":[  
           } "h264",
       }     }"hls"
         ],
    video: "1234567",//optional    "deep_link":"frequency://video/6415162182727646499",
    autoplay: true, //optional default false     "source_id":"video7316576222416856667",
         "source_url":"https://qa-freq-media.frequency.com/videos/6415162182727646499/1p1gxhsswx8re1xi6lyzl1srs.mp4",
      events: {// optional   "meta_tags":null,
      	onStateChange(state) {
			...
		}  "referrer_link":"http://www.frequency.com/video/jeff-sessions-says-u.s.-/6415162182727646499?cid=6341811119618533518",
       } })
 "ad_tag":null,
           

Constructs a Player object for video playback.

Constructor also accept element, which will be replaced by video player (* PlayerLite can only accept existing video element)

Code Block
languagejs
// element provided as string
new Frequency.Player('#player', {...});
 
// element provided directly as DOM node
new Frequency.Player(document.getElementById('player'), {...});
new Frequency.PlayerLite(document.getElementsByTagName('video')[0], {...});

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.

session - User session tokens required for activities.

api - Api configuration for activities.

config - player configuration.

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(video_id[, autoplay:boolean])

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

Parameters:

video_id - string with video_id that will be played

Returns:

void

 

loadChannel

 

Code Block
loadChannel(channel_id[, autoplay:boolean])

 

Loads video feed for specified channel_id. The onMediaReady event would need to be monitored along with a subsequent video play() method call to cause the loaded video to play.

 

Parameters:

 

channel_id - string with channel_id that will be played

 

Returns:

 

void

 

 

 

setVolume

Code Block
setVolume(volume:Number)

Sets player volume.

 Parameters:

 volume - New volume value for player. Value must be in range 0-100 

Returns:

void 

getVolume

Code Block
getVolume()

Returns current volume for the player.

Parameters:

 none

Returns:

 Number

 

isFullscreen 

Code Block
isFullscreen()

Returns true if player is in fullscreen mode.

Parameters:

 none

Returns:

 Boolean

requestFullScreen

Code Block
requestFullScreen()

Tries to put player in fullscreen mode.

Parameters:

 none

Returns:

 none

exitFullScreen

Code Block
exitFullScreen()

Tries to disable fullscreen mode for player.

Parameters:

 none

Returns:

 none

setSession

Code Block
setSession(session:Object)

Updates player session for activities.

Parameters:

session - Session object ({'X-Frequency-Auth': '...', 'X-Frequency-DeviceId': '...'})

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 properties

version - current player version

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.

...

languagejs

...

"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":[
            

...

 

...

onReady

...

Function

...

JS player ready for actions.

...

languagejs

...

   "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,
           

...

 

...

onMediaReady

...

Function

...

Media player ready.

...

languagejs

...

 

...

     

...

  "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]"
            

...

 

...

onStateChange

...

Function

...

Player state has changed.

...

languagejs

...

 

...

     

...

     ],

...

         

...

               "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]"
              

...

 

...

onProgress

...

Function

...

Players progress changed.

...

languagejs

...

 

...

     

...

   ],

...

         

...

               "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":[

...

 

...

 

...

 

...

 

...

 

...

 

...

 

...

 

...

             

...

languagejs

...

       "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":[

...

 

...

 

...

 

...

 

...

 

...

 

...

 

...

             

...

 

...

languagejs

...

       "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]"
                        ],
               

...

 

...

Activity call failed.

 

...

languagejs

...

        "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/"
                    }
            

...

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.

 

SEEKING5Played seeking.
ERROR6Player interface returned error.

 

Code Examples

iOS sample project of implementation of the frequency javascript player in a webview - frequency-ios-sdk-demo.zip.

Android sample project of implementation of the frequency javascript player in a webview - HelloFrequencyPlayer-android.zip.

Demo

Frequency Player Demo

 

 

 

    }
            ]
        }
    }
}
}

 

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