Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Can I request an autoplay feature ie so the file is played when the page loads?
Here is the UI for my D7 site which uses https://www.drupal.org/project/mediaelement
Comment | File | Size | Author |
---|---|---|---|
#11 | Screenshot 2019-07-25 at 09.17.35.png | 160.2 KB | cside |
#7 | Screenshot 2019-07-24 at 21.58.29.png | 825.98 KB | cside |
#5 | Screenshot 2019-07-24 at 10.37.46.png | 105.12 KB | cside |
autoplay.jpg | 105.02 KB | Juc1 |
Comments
Comment #2
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedAdded this feature in the latest development version. Thanks for your feedback!
Comment #3
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedFixed in 8.x-1.3
Comment #5
cside CreditAttribution: cside commentedHi,
I'm re-opening this issue as i cannot get Autoplay to work.
I'm using Drupal 8.7.5 and have used both the latest Audiofield version as well as the dev version. I have tried a number of different players and none activate the autoplay feature.
Attached is my setup.
Thanks
Comment #6
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedI have tested the default installation of audiofield and autoplay works with all players.
Can you confirm that your template file
audioplayer.html.twig
is up to date?Comment #7
cside CreditAttribution: cside commentedFrom what i can see it is up to date. I have attached a screenshot
Comment #8
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedDo you have a local version in your theme? When you load the audioplayer, what does the HTML look like? Is the autoplay flag there?
Comment #9
cside CreditAttribution: cside commentedI get this in the JS Console on a node with audiofield and with autoplay selected in display:
Autoplay is only allowed when approved by the user, the site is activated by the user, or media is muted.
Comment #10
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedThat's a browser issue, not an issue with the module
Comment #11
cside CreditAttribution: cside commentedOk ... i have done some extensive testing here.
The test page is here: http://qleva.netnebulis.se/node/170
I can get autoplay to work with Soundwave media player on:
- Mac with Firefox
- Android with Firefox
I cannot get it to work with:
- Any other media player on any web browser on any platform
- Soundwave on Mac with Opera, Google or Safari
- Soundwave on Android with Chrome
- Soundwave on iOS Mobile with Firefox, Chrome, Opera, Safari, Edge and various other custom web browsers
I have used various devices on several different internet connections and cleared all browser caches etc
I have attached the console output from Chrome.
Comment #12
tamerzg CreditAttribution: tamerzg at Websolutions Agency commentedAs of April 2018, Chrome's autoplay policies changed:
"Chrome's autoplay policies are simple:
Muted autoplay is always allowed.
Autoplay with sound is allowed if:
User has interacted with the domain (click, tap, etc.).
On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
On mobile, the user has added the site to his or her home screen.
See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
As for iOS/Android mobile browser's ignore the autoplay attribute on and elements. Stupid reasons include saving mobile bandwidth on behalf of the user.
Comment #13
msypes CreditAttribution: msypes commentedTo add to @tamerzg's info, Firefox is even more strict since early 2019. In short, unless you've already given a site permission to autoplay, it won't allow it. You can see "
Autoplay is only allowed when approved by the user, the site is activated by the user, or media is muted.
" in the console anytime a site attempts it.I've been working on a project where autoplay is expected, and I'll have to inform my client that's a no go.