At the completion of this session initialization step, a Yospace session object was received and through its
getPlaybackUrl() the URL for playing video (with server-side ads inserted) can be loaded into the player for content/ads presentation.
To an uninformed player or player data collector, the server-side inserted ads are indistinguishable from real contents under the same video stream. For a Datazoom collector to identify these ads and report ad data points accordingly, it must be given access to the Yospace session object in order to derive the extra information needed for handling SSAI ads. This is discussed in the next section.
Attach Yospace Session Objects
As in most Datazoom collector integrations, as soon as a player instance is created, a Datazoom collector context is created in order to collect data for this specific player. Now, we must perform one additional context method call to give the Datazoom collector context the access to the Yospace session object.
The context method is named
attachYospaceSession() and it should be called as soon as the Yospace session object becomes available, as demonstrated in the following example:
That’s it. The Datazoom collector is now provided with the required access to gather SSAI ad related information.
Normally the Yospace Ad Management SDK relies on the application to forward selected player events/data into the Yospace SDK, in order to gather playback status information or important timed metadata. However, if the Datazoom collector is given access to the Yospace session object as demonstrated above, we will function as a bridge between the player and Yospace SDK to meet these integration requirements, so the application can be spared from the extra effort.
Register SDK Event Callbacks to Update UI for SSAI Ads
The application may register callback functions to be invoked by Datazoom collector SDK when the current playhead enters or leaves the time span of a SSAI ad, as demonstrated below:
In the sample code above, the Datazoom collector context corresponding to the player is passed as the
context argument. Besides, the native ad object (as defined by Yospace here) is passed as the
ad argument – it contains useful information such as the ad’s skip offset value.