audio play automatically on `src` change with unique URL but same audio when `autoPlay` is `false`
See original GitHub issueIn here, if src
changes, audio gets played auto even we say autoPlay
is false
.
We should either add one more condition like ... && autoPlay
or completely disable this feature. Otherwise, in some cases, audios get played all the time.
For example; I regularly update components and when components updated, links get refreshed. Audio is same but each time update made, there is an unique encoded URL for each audio. So, with default, even if i select to not play audio automatically, its get played by this library because of this condition.
I’ve removed this on my repository and point the package there. I can create PR for this, if you want.
Just let me know which path should we follow here:
- a. adding one more condition
- b. completely remove this line
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Autoplay guide for media and Web Audio APIs
Automatically starting the playback of audio (or videos with audio tracks) immediately upon page load can be an unwelcome surprise to users.
Read more >HTML embed autoplay="false", but still plays automatically
Find "Autoplay" and click the "Settings" button. In the dropdown change it to block audio and video. The default is just audio. Your...
Read more >HTML audio autoplay Attribute - W3Schools
The autoplay attribute is a boolean attribute. When present, the audio will automatically start playing as soon as it can do so without...
Read more >Audio or video element that plays automatically has a control ...
This rule applies to any audio or video element for which all the following are true: (autoplay) the element has an autoplay attribute...
Read more >Autoplay policy in Chrome - Chrome Developers
# New behaviors · Muted autoplay is always allowed. · Autoplay with sound is allowed if: The user has interacted with the domain...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I re-considered this issue.
autoPlay
actually means auto play when first time DOM is loaded, not means every timesrc
changes.So I added another prop
autoPlayAfterSrcChange
which defaults totrue
because most music players are like this behavior.Currently, I am using my own fork as;
However, I will publish a npm package for this.