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

Sound broken in demo? #1055

Closed
npolys opened this issue Apr 1, 2020 · 11 comments · Fixed by #1110
Closed

Sound broken in demo? #1055

npolys opened this issue Apr 1, 2020 · 11 comments · Fixed by #1110

Comments

@npolys
Copy link

npolys commented Apr 1, 2020

https://examples.x3dom.org/example/x3dom_comic.xhtml

.... would an .mp3 be played ??

@andreasplesch
Copy link
Contributor

andreasplesch commented Apr 1, 2020

Here is related background: #773
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
https://hacks.mozilla.org/2019/02/firefox-66-to-block-automatically-playing-audible-video-and-audio/
What may work is wait for user interaction on the page and then set enabled='true'.

@andreasplesch
Copy link
Contributor

Here is a build which retries playing until successfull, eg. when the user interacts:

https://5e84aff60cc298000663822b--x3dom.netlify.com/

It needs enabled='true' for AudioClip. Please give it a try. I think it would be safe to adopt the fix.

@andreasplesch
Copy link
Contributor

Did that change help ? If so I can merge it.

@andreasplesch
Copy link
Contributor

@npolys Any luck with the sound fix ?

@MarkCallow
Copy link

MarkCallow commented Aug 20, 2020

I'm getting

Loading failed for the <script> with source “https://5e84aff60cc298000663822b--x3dom.netlify.com/”

when I try that build with my scene. Is "netlify" a typo?

To answer my own question, I get the same error with netify

@andreasplesch
Copy link
Contributor

Sorry, I should have been more explicit. Try:

https://5e84aff60cc298000663822b--x3dom.netlify.app/x3dom-full.debug.js

@MarkCallow
Copy link

MarkCallow commented Aug 20, 2020

This build works while the release build doesn't. Now when I click on Floops the animation and the audio start.

One time after a reload the audio was out of sync but I couldn't reproduce after several more attempts.

Why isn't audio enabled when the startTime is set via an event? For now I've set enabled='true' in the AudioClip attributes.

@andreasplesch
Copy link
Contributor

Thanks for the confirmation.

It turns out startTime is not implemented. I do not know why. Perhaps because it would require an additional check at each tick.

You may be able to route the isActive event from the TouchSensor to AudioClip via a BooleanFilter (since enabling should happen on isActive = false).

@MarkCallow
Copy link

If startTime was implemented then I think my sample would have just worked. The sensor click should have both satisfied the browser's user interaction requirement and by setting the AudioClip's startTime started playback. I will file an issue.

@MarkCallow
Copy link

When will this fix appear in www.x3dom.org/x3dom/release?

@andreasplesch
Copy link
Contributor

It is already available at

https://x3dom.org/download/dev/

Not sure what the plans for a new release are.

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

Successfully merging a pull request may close this issue.

3 participants