To add an authentication token to the header for each request called by Azure Media Player to get caption content, you can use the ProtectionInfo
object in Azure Media Player. The ProtectionInfo
object allows you to specify a token that will be added to the header of each request made by the player.
Here is an example of how to use the ProtectionInfo
object to add an authentication token to the header:
var myOptions = {
"nativeControlsForTouch": false,
"controls": true,
"autoplay": false,
"width": "640",
"height": "400",
"plugins": {
"azuremediaplayer": {
"src": "http://amssamples.streaming.mediaservices.windows.net/69fbaeba-8e92-43f2-867a-fb033bdc6d2f/AzureMediaServicesPromo.ism/manifest",
"protectionInfo": [{
"type": "AES",
"authenticationToken": "your-authentication-token"
}]
}
}
};
In the protectionInfo
object, you can specify the type of protection you want to use (in this case, AES) and the authentication token you want to add to the header of each request.
For more information on how to use the ProtectionInfo
object in Azure Media Player, you can refer to the official documentation.