Page tree

Versions Compared

Key

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

...

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

2 
Version #DescriptionRelease Date
3.0.212 

BugfixesChanges:

  • 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:

  •  
2.0.1
  • ad_tag no longer required - configuration kept in ad server
2.0.0
  • Ad handled via decisioning server
  • Unified constructors for Player and PlayerLite version
  • Accept resolution and bitrate parameters within player for ad request
  • [Player] Player can't use ad_tag provided by frequency services if player is loaded over HTTPS

  • [Player] Impossible to change AdsConfiguration for loadVideo method.

  • [Player] Event onProgress is received after state PAUSED

  • [Player] Subtitles are enabled by default on YouTube

Breaking changes:

  • Unified constructor for both versions
  • setSesion method is now asynchronous
  • adConfig object no longer accepts adCuePoints and adTag
  • video object is now compatible with API video object
1.3.7

Fixes:

  • AC-227 Youtube videos are not filling the entire player field of view
  • LG-154 [Player] versioning support when loading from CDN - Base path param
  • AC-212 All videos cease to play
  • LG-157 [Player] youtube video breaks play

 

1.3.6

Fixes:

  • LG-154 - [Player] versioning support when loading from CDN
  • LG-146 - [Player][Android 4.1.2] There is playback in the corner in small size
1.3.5Fixes:
  • Player doesn't save mute state for videos.
  • Edge Incorrect handling for Ended and Seek statuses for some videos. 
  • Player throws incorrect state ENDED (Nexus 7)
  • Duplicated events listeners

Player light build (with mp4 player only)

1.3.4Internal testing
1.3.3Support for different video urls (direct, embed)
1.3.2Offline events, bugfixes.
1.3.0

Fullscreen API, Activity events errors and change session support

1.2.1Possibility to change API url for activities
1.2.0Video activities, poster, bugfixes

1.1.0

 

Volume control functions and bugfixes.
1.0.0This is the first version of the Frequency player that supports VMAP, VPAID, VAST 2.0, VAST 3.0 advertising standards and MP4 and HLS video formats.
  • 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

...

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:

...

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,
        maxBitrate: 5000  "title":"Jeff Sessions Says U.S. May Use DNA Tests to Verify Family Relationships at Border",
        maxResolution: '720p',
        deliveryFormat: 'progressive'
    },
    video: {// mandatory
    "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.",
    "video_id     "resolution":"1280x720",
"12345",// mandatory         "resolutions":null,
         "titleduration":59,
"Gangnam Style"         "source":"Veuer",
         "score":0,
         "descriptionchannel":{ "Good Dance Video" 
            "title":"Veuer",
            "channel_id":"6341811119618533518",
            "image_url": "httphttps://image1qa-freq-images.frequency.com/uri/w{width}_h{height}_ctrim_tt1406242656000/_/item/1/8/3/2/Kelsey_Grammer_Welcomes_6th_Child_183236961_thumbnail.jpg"channel/1rbhzt34412fd16ps1zgrx35f/original/1rbhzt34412fd16ps1zgrx35f.jpg"
         },
         "deepvideo_linkid":"6415162182727646499",
"frequency://video/12345/-/4-895         "content_partner_id":null,
         "image_url":"https://qa-freq-images.frequency.com/video/1p1gxhsswx8re1xi6lyzl1srs/original/1p1gxhsswx8re1xi6lyzl1srs.jpg",
         "media_url": "httphttps://clips.vorwaerts-gmbh.de/big_buck_bunnyqa-freq-media.frequency.com/videos/6415162182727646499/C3VHmxAgS-G4.mp4",//
mandatory         "media_type": "h264",
         "media_types": [[  
            "h264",
            "hls"
         ],
         "resolutiondeep_link":"frequency://video/6415162182727646499",
"1080p"         "source_id":"video7316576222416856667",
         "resolutions": ["1080p", "720"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
         ],
         "durationdate_publish": 3600"2018-06-20T11:09:00Z",
         "date_available":"2018-06-20T11:28:26Z",
         "sourcedate_expired":null,
"Online"         "last_updated":"2018-06-20T11:28:26Z"
      },
      ...
 "source  ],
   "page":{  
      "page_id":null,
"X8yZ4f",// mandatory      "page_size":30,
      "page_offset":"1",
      "sourcepage_urlmark": "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://www.eonlineqa-freq-ad-eu.frequency.com/videos/223996/kelsey-grammer-welcomes-6th-child",
        "score": 126,
        "meta_tags": [
            {"network": "Machinima"}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":{
   {"genre     "id": "Gaming94691571"},
            {"subgenreinLine":{
"Action"}            "adSystem":"GDFP",
            {"series    "adTitle":"Mountain Dew NBA"Random,
LOL Moments"}                "description":"Mountain Dew NBA ad",
            {"season    "error":[
"1"}                "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoplayfailed[ERRORCODE]"
            ],
            {"episode    "impression":[
"489"}                "http://pubads.g.doubleclick.net/pcs/view?xai=AKAOjsvdVj_cxz0fwuQcC65H3U2j_GegtDEvbT_z_JWt2zrFC361C4AJM885ooCz66XTeOYJ28lg_SyEA7nDuK61IZWXsevp_8GpXHilXGR9wap0vrndyInz7zpGviqyfX6qBACXqu1GjJ4CroW1Kdc55dS981D_J4hC_ZMspaDhd3MYAVL_6BX2pNXXoXjxUybye0VFtNdw9eAOwqG0HtEX_gsLO1ZeTzjFiEccluIVOC4&sig=Cg0ArKJSzEscm6_-DknEEAE&adurl="
            ],
        "channel        "creatives":[
                {
            "channel_        "id":"107074364451",
"4-1234"                    "sequence":1,
            "title        "skipoffset":5,
"News"                    "duration":30,
            "image_url        "trackingEvents":{
                        "start":[
                            "http://image1pubads.frequencyg.comdoubleclick.net/uri/w{width}_h{height}/_/user/1/8/5/0/1385085551000_abc_nightly_news_1850953_avatar.jpg",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]"
        }                ],
        "referrer_link": "https://twitter.com/zgutierrez90/status/446459061161451520"                "midpoint":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=videoplaytime50&ad_mt=[AD_MT]"
                        ],
        "ad_tag": "https                "thirdQuartile":[
                            "http://pubads.g.doubleclick.net/gampadpagead/adsconversion/?szai=640x480BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&iusigh=%2F105934051%2FtestAdUnitjqiKXXJbZho&impllabel=svideoplaytime75&gdfpad_req=1&env=vp&output=vast&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=1485732061110",// optionalmt=[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]"
                        ],
                        "ad_cue_points": [0],// mandatory for adsrewind":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adrewind&ad_mt=[AD_MT]"
                        ],
           "date_publish             "pause":[
"2014-07-29T14:18:10Z"                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adpause&ad_mt=[AD_MT]"
                        ],
        "date_available": "2014-07-29T14:18:10Z"                "resume":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adresume&ad_mt=[AD_MT]"
                        ],
        "date_expired": "2014-07-29T14:18:10Z"                "fullscreen":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=adfullscreen&ad_mt=[AD_MT]"
                        ],
        "last_updated": "2014-07-29T14:18:10Z"                "creativeView":[
                            "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=vast_creativeview&ad_mt=[AD_MT]"
                        ],
        "autoplay                "exitFullscreen":[
true     },     events: {// optional     	onStateChange(state) {
			...
		}          "http://pubads.g.doubleclick.net/pagead/conversion/?ai=BHF2xXE0qW6CmD4qNxwLw_avABeHCp5JFAAAAEAEgq9bfKDgAWKPIhPGOA2Dp5JqP8Bq6ARMzMzZ4MjY5LDY0MHg0ODBfeG1syAEFwAIC4AIA6gIQLzEwNTkzNDA1MS9sZ2kuLvgC8NEekAPIBpgDrAKoAwHQBJBO4AQB0gUFEPPBky2QBgGgBiOoB5jOG9gHAeAHH9IICQiA4YBwEAEYAw&sigh=jqiKXXJbZho&label=vast_exit_fullscreen&ad_mt=[AD_MT]"
       } })             

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)

Loads the video specified by the video object. 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:

video - video object described in Player Fields section.

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 Ads Configuration

Code Block
Frequency.Player.AdsConfig

Ad 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.
onVolumeChangeFunctionPlayer volume has changed.
onActivityErrorFunctionActivity call failed.

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

Demo

Frequency Player Demo

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

 

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