-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOMException: play() failed because the user didn't interact with the document first #145
Comments
The error also has this helper link, hope that will be helpful. |
and I found this from SO where it says, the fix is to make the video Muted Appreciate your help. |
I believe I had the same issue (Firefox 108.1.0, Android 6).
Solved it by adding var NoSleep = function () {
function NoSleep() {
...
if (nativeWakeLock()) {
...
} else if (oldIOS()) {
this.noSleepTimer = null;
} else {
// Set up no sleep video element
this.noSleepVideo = document.createElement("video");
this.noSleepVideo.setAttribute("title", "No Sleep");
this.noSleepVideo.setAttribute("playsinline", "");
this.noSleepVideo.muted = true; // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this._addSourceToVideo(this.noSleepVideo, "webm", webm);
...
} |
Expected Behavior
It should run the video muted so it does not throw a js error.
Actual Behavior
It throws a Js error "DOMException: play() failed because the user didn't interact with the document first"
Code
How Do We Reproduce?
Use it on a blank page and check the console, please.
The text was updated successfully, but these errors were encountered: