<head></head>
section of your web-app or pages where videos are supposed to be played:externalIdentifier
is a string (up to 64 chars) you set to uniquely identify your user. It might be a UUID, a hashed email address or anything that allows you to persistently identify a user.optionalParameter
is an optional string (up to 32 chars) you can use to add an additional reporting dimension the video statistics. It can be accessed and filtered in the video adslot statistics and the reporting API.requestAd
before the initialization of the SDK is complete, otherwise the call will fail.
Also note, that after a success callback a video ad is ready to be played. However, depending on your video demand sources, successful bids will time-out after a while (usually 1-60 minutes).
It's advisable to make a requestAd
call just in time when a video should be played.requestAd
success callback which itself has been called from a user-interaction.
Otherwise video autoplay will be rejected by most browsers and we must render an additional button over the video for the user to click, which lowers the acceptance and usability.play...Ad
functions will silently abort if an ad is already playing. In all other cases, they make use of the global callback handlers described in the Initialization & Global Callback Handlers section.requestAd
and play...Ad
, for example:destroy
:AyetVideoSdk.callbackRewarded
function shown in Initialization & Global Callback Handlers:signature
.
Signature calculation example:AyetVideoSdk.setCustomParameter('custom_n', 'value')
is available.
Where:
custom_n
can be one of these: custom_1, custom_2, custom_3, custom_4, custom_5
.
value
is a string (up to 64 chars).
AyetVideoSdk.setCustomParameter
can be called any time with the most recent content used when a video view is completed.ayetvideosdk
:AyetVideoSdk.callbackError
function that can be configured and is invoked for any type of callback errors:
AyetVideoSdk.callbackError = function(e) {console.log("callbackError: "+JSON.stringify(e));};
AyetVideoSdk.requestAd(adslotName, successFunction, errorFunction);
that is invoked if an ad request did not succeedAyetVideoSdk.callbackError
:no adTagUrl set, no video ad available.
requestAd
or the request was unsuccessful.provided ad unit did not start.
provided ad unit stalled.
provided ad unit is corrupt.
all bids expired or contained invalid VAST responses, unable to render ad.
unrecoverable ad error: {message}
AyetVideoSdk.requestAd(...)
error callback:no fill.
unhandled client exception.
ayetvideosdk
during ad request.invalid server response.