HTML5 video autoplay DOM change WebKit bug
WebKit/Blink has a bug where making a DOM change to video elements will pause the video. This can prevent or stop video autoplay
. Arnaud Leyder has a solid explanation on Stack Overflow.
The hack fix is to re-trigger .play()
on the video after the DOM change has been made.
// make DOM change to video
elem.appendChild( video );
// trigger .play() to resume autoplay for WebKit
video.play();
See the Pen html5 video autoplay DOM change WebKit bug by David DeSandro (@desandro) on CodePen.