Live - DASH
Last updated
Last updated
The process to request a Serverside.ai DASH-Live stream with client-side tracking enabled can be broken down into the following steps (the technical details for every step follow below):
The App performs a request to the Serverside.ai endpoint for a channel and retrieves the URL to the DASH manifest (mediaURL) and VAST data (vastURL)
The mediaURL can now be used to initialize the player and start playback. (Note: in the example below we use a Shaka-Player in an HTML5 environment)
Parallel to step 2 the app can perform a request to the vastURL to load the current VAST information for the live-channel
While the player is constantly loading sub-manifests and media-chunks for playback the app has initialized the VAST handling and is waiting for the player to reach an ad
As soon as an ad signaled in the VAST-Tag is starting to playback, compared to the timeline information from the player or timeline-region-enter events the app will send requests to all tracking-URLs (beacons) defined in the VAST-response for the start event. The same logic applies to the events: pause, resume, finish, firstQuartile, midpoint, thirdQuartile, complete
The first request to obtain a dash-manifest and VAST tracking information will create a DASH-Live session for the requesting client. The URL to the ad-insertion enabled channel is called outputUrl and can be viewed at Serverside.ai or via https://admin.serverside.ai/api/v2/channels/:channelId
API endpoint.
GET Request:
Response body:
Before calling the vastUrl you have to attend the AdId which can be found in the response of the mediaURL as described below.
The full URL schema is:
You will find below an example of how to playback a Serverside.ai DASH-Live stream in a browser.
For any other player and environment you have to load and initialize your player of choice. Afterward, pass it the mediaURL and start the playback.
HTML
JavaScript
To gather the VAST-related data call the vastURL
gathered in step 1.
Build the URL the following way: ${vastURL}/${adId}.xml
GET Request:
Response Body:
Each period in the DASH manifest that signals an inserted ad clip contains an event stream for the VAST tracking.
The first event id=vast:adId
signals an id under which the whole original VAST response, including all tracking event information for the respective clip, can be obtained from the SSAI-API under the provided vastURL contained in the initial session created response. The following events, id=beacon:start etc. trigger the VAST quartile reporting at the respective points in the clips presentation timeline.
Every time a new ad is signaled in the DASH manifests, continuously pulled by the player, the app needs to load the vast information for this ad
At the time an ad is detected in the DASH-Stream fetch the vast information for this ad from the vastURL
: ${vastBaseUrl}/${adId}.xml
.
How to get access to the timeline events is highly dependent on the player you are using.
Javascript - Shaka-Player:
As soon as the VAST information for the upcoming ad is loaded the client needs to track if the player reaches one of the predefined timeline positions and fire the events accordingly
Javascript - Shaka-Player:
The above example only handles the start of an add. You have to implement the handling for pause, resume, finish, firstQuartile, midpoint, thirdQuartile, and complete as well.
See the below example implementation for a full example of the DASH Vast tracking.
The example implementation handles Impression- and progress (beacon) events based on the DASH event timeline as well as the following tracking events based on HTML5 video element events:
mute/unmute
pause
resume
expand/collapse