Verstehe das gerade nicht weil ich da kein problem sehe. Das hat man doch schon öffters gemacht und auf einmal geht es nicht mehr.Zumindest mit anderen Elemente
Habe ich da was übersehen ?
Code
var element = document.createElement('video');
element.id = 'video1';
element.src="https://www.w3schools.com/html/mov_bbb.ogg";
element.preload = 'load';
element.type="video/ogg";
element.setAttribute("controls", '')
element.setAttribute("autoplay",true);
document.getElementById("k").appendChild(element);
//function playPause(){
setTimeout(function(){
// document.getElementById("video1").play();
},1000);
//}
Alles anzeigen
Die Fehler konsole sagt das
Zitat
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
aber erst wenn wenn man den play() hinzufügt. Ohne Play passiert einfach gar nix.
setAttribute auoplay läuft auch nicht