Hello,
Currently, main part of
It works well unless we go into the "catch" block. Here the problem is that
We tested this using different OS and browsers, including main target (Mac Safari), with the same result.
Currently, main part of
playFirstVideo()
method is following:
JavaScript:
if (src) {
video.src = src;
video.play().then(function () {
display.appendChild(video);
resolve();
})["catch"](function () {
//WCS-2375. fixed autoplay in ios safari
logger.info(LOG_PREFIX, "Autoplay detected! Trying to play a video with a muted sound...");
video.muted = true;
video.play().then(function () {
display.appendChild(video);
resolve();
}); //WCS-2375. low power mode suspends video play
video.onsuspend = function (event) {
reject();
};
});
return;
}
video.onsuspend
is always called before video plays, i.e. promise is rejected without any chance to be resolved. If we comment reject();
out, everything works well.We tested this using different OS and browsers, including main target (Mac Safari), with the same result.