Skip to content
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 not catched #55

Closed
Phyks opened this issue Aug 22, 2018 · 3 comments
Closed

DOMException not catched #55

Phyks opened this issue Aug 22, 2018 · 3 comments

Comments

@Phyks
Copy link

Phyks commented Aug 22, 2018

Hi,

When running a webpage using NoSleep in the latest Chromium build for Android, I get a

DOMException: Failed to load because no supported source was found.

Which is never caught. I tracked it down to https://github.com/richtr/NoSleep.js/blob/master/src/index.js#L37 where it should be caught on play. I guess actually the enable method might return the play Promise so that user can deal with issue the way they want, no?

For the deeper underneath issue raising this exception, it seems Chromium on Android has no support for MP4 video files (not sure whether Chrome does). Replacing https://github.com/richtr/NoSleep.js/blob/master/src/media.js by a WebM converted video works well!

Maybe NoSleep could provide the source file in both MP4 and WebM and let the browser play the best fitted one?

Thanks!

@richtr
Copy link
Owner

richtr commented Dec 4, 2018

It's a good idea and I think this relates to discussion @ #47.

This library has used WebM files in the past and I aim to resurrect that usage in an upcoming release.

Maybe NoSleep could provide the source file in both MP4 and WebM and let the browser play the best fitted one?

I think this is a good idea. Provide two video sources and let the browser pick one. Regarding #47 I think the WebM video should not include an audio track.

I already created the perfect WebM video file with no audio track to use a while ago btw ;)

From mathiasbynens/small#10:

Single-frame 8×8px WebM video without sound.
185 bytes

https://github.com/mathiasbynens/small/blob/master/webm.webm

I will continue looking in to this.

@richtr
Copy link
Owner

richtr commented Dec 4, 2018

Fixed by #58.

This will now be released as v0.9.0.

@richtr richtr closed this as completed Dec 4, 2018
@Phyks
Copy link
Author

Phyks commented Dec 4, 2018

Great! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants