aframevr / aframevr/aframe

`sound` component not loading audio in Firefox

Open
#3,868 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

Description:

Using the current A-Frame master, when trying to auto play audio with the sound component using autoplay: true, either the loading screen times out and the audio doesn't play, or the loading screen skips and the audio doesn't play.

This seems to be affecting Firefox on pretty much every platform I've tested. In Chrome, everything loads almost immediately and the audio plays as expected.

In Firefox, console says:

components:sound:warn Sound not loaded yet. It will be played once it finished loading 

The audio never plays.

If I try document.querySelector('audio'), play(), it will play, but it appears the sound component gets hung up.

document.querySelector('[sound]').components.sound.playSound() throws the same console message.

I processed the audio with ffmpeg in the second demo, to make sure it wasn't an encoding issue, but no dice.

  • A-Frame Version: master 826e983d989312fe7cd75b9cc92e58b7a5cc195f
  • Platform / Device: Firefox on Windows/Mac/Android...
  • Reproducible Code Snippet or URL:

https://bunker-bake.glitch.me
https://spiral-lipstick.glitch.me

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in Firefox using the two demos at bunker-bake.glitch.me and spiral-lipstick.glitch.me, then trace the A-Frame sound component's loading path. Compare its behavior with direct HTMLAudioElement playback and verify that autoplay audio loads and plays in Firefox without the reported warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.