Although @richard-lindner's solution didn't work for me, it put me on the right track.
In my case, although the muted
attribute was present, Chrome was ignoring it and failing silently unless it was also explicitly set in javacript e.g.
var video = document.getElementById("myVideo");
video.oncanplaythrough = function() {
video.muted = true;
video.play();
}
Interestingly, forcing the autoplay using javascript but ommitting the video.muted = true
line did display the autoplay policy error in the console, suggesting Chrome is indeed ignoring the muted
attribute in some cases. This to me feels like a bug with Chrome's autoplay policy.
Note that the error occurred only when the video was not cached. If it was cached, autoplay worked as expected.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…