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.
Would it be possible to include a setting that prevents the automatic download of mp3 files?
I'm building a sermon archive using mediaelement as the player. However, when a user visits a view displaying 10 - 20 sermons, all files start downloading immediately. I know this would have to be available in the mediaelement API to implement. Not sure if the load() method could be used to control this.
ipixelout, which I used to use, didn't begin the download until the play button was pressed.
Thanks for the great module.
Comment | File | Size | Author |
---|---|---|---|
#35 | mediaelement_preload-1213956-35.patch | 2.59 KB | gbyte |
Comments
Comment #1
tvaughan CreditAttribution: tvaughan commentedI'd like this too - it needs some way of setting
preload
tofalse
in the audio or video tags.Comment #2
Poieo CreditAttribution: Poieo commentedThis seems to be related to private downloads and not necessarily the fault of this module. I change my file storage to public and it resolved the issue.
I was also having an issue with the player displaying NaNa errors for the file length...public storage solved that as well.
Comment #3
lyricnz CreditAttribution: lyricnz commentedI also have this problem, and don't use private files. I am however using the mediaelement field formatter on a Link field, which points to a remote URL. Again, the player controls start downloading the files immediately, but don't start playing until click. While this might be desirable in some circumstances, often it is not, as highlighted by the original poster. Investigating.
Comment #4
lyricnz CreditAttribution: lyricnz commentedAdding support for "preload" would fix this issue, but doesn't solve the general problem of wanting access to the other attributes available to mediaelement:
http://www.w3.org/TR/html5/video.html#video
http://www.w3.org/TR/html5/video.html#audio
poster
preload
autoplay
mediagroup
loop
muted
controls
Should we develop a general solution, or just add support for these?
Comment #5
lyricnz CreditAttribution: lyricnz commentedHere is a patch that provides support for "preload" flag to mediaelement.
Comment #6
Dave ReidComment #7
drewish CreditAttribution: drewish commentedDoesn't apply to HEAD right now.
Comment #8
drewish CreditAttribution: drewish commentedRe-rolled.
Comment #9
drewish CreditAttribution: drewish commentedSeparate issue but does it make sense to exposing those defaults?
Comment #10
Poieo CreditAttribution: Poieo commentedThe patch is working great for me. However, I'd like to see the default set to NOT preload.
I'm using this to display 10+ audio files via views on one page that are 30+ minutes long. If you forget to set the preload to false, once you add the field (or when you edit the view) the files start to preload in the preview bogging down the site/browser and making View's nearly impossible to edit until all the files are preloaded...which can take several minutes.
Thanks for the patch!
Comment #11
timofey CreditAttribution: timofey commentedI second #9 and #10. This is a major part. I have several audio files on the front page, which I most definitely don't want to preload.
Comment #12
leschekfm CreditAttribution: leschekfm commentedThe patch works for us, too.
We had a hard time to realize that the preloading of some audio tracks prevented our site from finishing to load, which as a side effect prevented anything from loading inside a colorbox.
So I would also pledge to make disabled the default option and commit this as soon as possible.
Nonetheless thanks for the patch :)
Comment #13
leschekfm CreditAttribution: leschekfm commentedSorry, meant to set the issue to needs work.
Comment #14
deggertsen CreditAttribution: deggertsen commentedI believe I've set the patch correctly so that it is set to not load by default, but haven't tested it. I also updated the patch to run against 7.x-1.x branch. Other than that it seems to work great and is ready to commit.
Comment #15
babbage CreditAttribution: babbage commentedI have the exact same issue as the original poster. This is nothing to do with private files. 25 mp3s of half and hour each in the view, almost stops this site dead when they are all preloading. Thought this module was my replacement for 1pixelout, not so sure now. I absolutely agree that this preloading should be set to FALSE by default.
Comment #16
Jackinloadup CreditAttribution: Jackinloadup commentedfixed white space issues as well as added preload information to the field_formatter_settings_summary
Comment #17
xacto CreditAttribution: xacto commentedThank you for this patch!
It should be added along with autoplay patch to the dev branch.
I had to reinstall a site that was using mediaelements with view.
And I couldn't figure out why everything was preloading again.
Forgot I patch it. LOL
Was trying to mod the code module myself at 2 AM
Bad Idea. ;-)
Thanks Again!!
Shouldn't we commit these patches by now?
Comment #18
deggertsen CreditAttribution: deggertsen commentedIt appears that the maintainers are not very active. Last commit over 1 year ago...
Comment #19
Dave ReidWell, if you think this patch is ready to be committed and it applies cleanly, then that is what the 'reviewed & tested by the community' issue status is for. Leaving issues in 'needs review' for a lot of maintainers means that it shouldn't be committed yet.
Comment #20
Poieo CreditAttribution: Poieo commentedBeen working great for me for me.
Comment #21
faqing CreditAttribution: faqing commentedTested #8 drewish patch in 7.x-1.2.
I patched in Ubuntu and upload to my site. It works!
I can not apply other patch in ubuntu.
You can try: http://thanhsiang.org/ch/node/3480
Note:
I use this module to replace swftools (d6).
I changed
<swf file='file.mp3'> to <audio src='file.mp3'><audio>
The great thing about this module: it also supports flv files by using video code. An ideal module to replace swftools (only works in D6).
Comment #22
lyricnz CreditAttribution: lyricnz commentedDon't change version. The patch, when/if it is applied, will need to be applied to -dev.
Comment #23
Dave ReidI'm wondering if 'none' is actually the correct default to use. According to http://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload it looks like maybe we should allow a 'None' option to not output any preload attribute and use that by default?
Comment #24
deggertsen CreditAttribution: deggertsen commented@Dave Reid Are you suggesting that we use Preload: Metadata? Please clarify what you are suggesting with your comment.
Just looking over http://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload it seems to me that "Metadata" may be an option to consider, however I still think 'none' is the best option. 'Automatic' is an option that I'm sure some would want to use on their sites, so it would be ideal if there was a global setting that could be set so people could choose which option they prefer. But I think that most of us are more concerned with the bandwidth usage that mediaelement uses when preload is set to automatic. Therefore it should default to 'none'.
Again looking at the above link there is this note that may need to be considered:
So ideally it would switch from 'none' to 'auto' once playback is requested, but I think that should maybe be a separate feature request. As for this issue, I feel that the patch addresses it well. Marking this as RTBC again, unless someone else disagrees about 'none' being the best option or if there is an issue with the patch.
Comment #25
deggertsen CreditAttribution: deggertsen commentedSilly me, forgot to mark this as RTBC. I also just went in to test the patch a bit more and realized that there IS a global setting for how preload should work under the file display settings. I've attached a screenshot of these settings.
I really think this is ready to commit.
Comment #26
xacto CreditAttribution: xacto commentedCan a maintainer please commit this patch to the dev version?
Thanks!!!
Comment #27
ErwinS CreditAttribution: ErwinS commentedPatch works fine!
plse commit it...
Comment #28
adam_bearPatch #16 works well- inspired me to make this:
https://github.com/ablank/imediaelement.module
Comment #29
Poieo CreditAttribution: Poieo commentedHey @adam_bear. Since this module is not being maintained, why not apply for co-maintanership and get some of these fixes committed?
Comment #30
adam_bear@Poieo- Good idea :)
The Mediaelement.js library is less than optimal for Drupal, but I can port most of the features without requiring the improved lib.
Comment #31
jordan8037310 CreditAttribution: jordan8037310 at Facet Interactive commentedRerolled #16 against 1.2. Didn't check it against --dev.
Comment #33
jnettikUpdated the patch in #32 to work against dev and committed. This should get ported to the D8 version as well. Updating the issue.
Comment #34
lamp5This is patch backported to D8 version.
Comment #35
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedThis is not major.
Re-rolling patch for 8.x-1.x. Please consider commiting as this is in 7.x already.
Comment #36
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedComment #38
jnettikCommitted! Thank you!