I am developing with Azure Media Player 2.3.11 on Windows 10.
I have the following code:
// JQuery
function initVideo(videoElementId, src, type, options, errorImageId) {
var myPlayer = amp(videoElementId, options);
myPlayer.addEventListener("error", function() {
const err = myPlayer.error();
const videoElement = $('#'+videoElementId);
const errorImageElement = $('#'+errorImageId);
videoElement.hide();
errorImageElement.show();
})
myPlayer.src([{ src: src, type: type }]);
}
const src = "video source URL (removed)";
const type="application/vnd.ms-sstr+xml";
var myOptions = {
techOrder: ["azureHtml5JS", "html5FairPlayHLS", "html5"],
nativeControlsForTouch: false,
autoplay: false,
controls: true,
width: "100%", // 622
height: "100%", // 388
poster: "",
imsc1CaptionsSettings: [],
};
initVideo("azuremediaplayer", src, type,myOptions, "errorImage");
The thumbnail of the video renders. If I click it promptly, the video plays fine.
If I do not click play, many HTTP 412 errors are raised, and eventually (after ~20 seconds) the error handler is called.
The final emitted error is:
[16:54:20.948] error: azureHtml5JS: httpDataRetriever: https://SNIPPED/644d461e-b88d-4aad-864c-36f82529248d/PH01-Test-26062023.ism/QualityLevels(128000)/Fragments(audio_und=49277328,format=mpd-time-cmaf) failed, httpStatus: 412
azuremediaplayer.min.js:19 [16:54:20.948] error: azureHtml5JS: httpDataRetriever: Module = httpDataRetriever FailureCode = 0x0020019C https://SNIPPED/644d461e-b88d-4aad-864c-36f82529248d/PH01-Test-26062023.ism/QualityLevels(128000)/Fragments(audio_und=49277328,format=mpd-time-cmaf)
azuremediaplayer.min.js:19 [16:54:22.950] error: azureHtml5JS: workflowSequencer: stepRejected: Module = httpDataRetriever FailureCode = 0x0020019C https://SNIPPED/644d461e-b88d-4aad-864c-36f82529248d/PH01-Test-26062023.ism/QualityLevels(128000)/Fragments(audio_und=49277328,format=mpd-time-cmaf)
azuremediaplayer.min.js:19 [16:54:22.950] error: azureHtml5JS: workflowCoordinator: mediaRequestRejected: audio module: httpRetryPolicy
azuremediaplayer.min.js:19 [16:54:22.950] error: azureHtml5JS: workflowCoordinator: Dispatching error: code: 0x0020019C, msg: https://SNIPPED/644d461e-b88d-4aad-864c-36f82529248d/PH01-Test-26062023.ism/QualityLevels(128000)/Fragments(audio_und=49277328,format=mpd-time-cmaf)
azuremediaplayer.min.js:19 [16:54:22.951] error: videojs: 2.3.11.2 (CODE:538968476 undefined) https://SNIPPED/PH01-Test-26062023.ism/QualityLevels(128000)/Fragments(audio_und=49277328,format=mpd-time-cmaf) [object Object]
Why does this happen, and how do I fix it?
There is a codepen for this on: https://codepen.io/ScottTunstall/pen/GRwNWeb