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

audio-basics fails out of the box #35

Closed
madc0w opened this issue Jul 26, 2020 · 3 comments
Closed

audio-basics fails out of the box #35

madc0w opened this issue Jul 26, 2020 · 3 comments

Comments

@madc0w
Copy link

madc0w commented Jul 26, 2020

pushing the play button results in:

index.html:81 Uncaught (in promise) DOMException: The element has no supported sources.

here:

audioElement.play();

@madc0w madc0w changed the title audio-basics fails out of the boxindex.html:81 Uncaught (in promise) DOMException: The element has no supported sources. (anonymous) @ index.html:81 audio-basics fails out of the box Jul 26, 2020
@Leokuma
Copy link
Contributor

Leokuma commented Jul 26, 2020

That's probably because you're opening index.html directly from the filesystem.

If you access it through a web server (e.g. Apache), it works.

I couldn't figure out how to make it work without a web server.

@chrisdavidmills
Copy link
Contributor

I couldn't figure out how to make it work without a web server.

You can't, due to browser security policies.

@teoli2003
Copy link
Member

Closing. These demos don't work from a file: filesystem (security policies). To test locally, there are extensions to common code editors, like VSCode, that allow opening a page in a local web server. (I use this to test these pages when I adapted them to modern JS)

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

4 participants