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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tvaughan’s picture

I'd like this too - it needs some way of setting preload to false in the audio or video tags.

Poieo’s picture

Status: Active » Closed (works as designed)

This 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.

lyricnz’s picture

Status: Closed (works as designed) » Active

I 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.

lyricnz’s picture

Adding 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?

lyricnz’s picture

Status: Active » Needs review
FileSize
2.83 KB

Here is a patch that provides support for "preload" flag to mediaelement.

Dave Reid’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
drewish’s picture

Status: Needs review » Needs work

Doesn't apply to HEAD right now.

drewish’s picture

Status: Needs work » Needs review
FileSize
3.2 KB

Re-rolled.

drewish’s picture

Separate issue but does it make sense to exposing those defaults?

Poieo’s picture

The 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!

timofey’s picture

I 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.

leschekfm’s picture

Status: Needs work » Reviewed & tested by the community

The 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 :)

leschekfm’s picture

Status: Needs review » Needs work

Sorry, meant to set the issue to needs work.

deggertsen’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.85 KB

I 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.

babbage’s picture

I 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.

Jackinloadup’s picture

fixed white space issues as well as added preload information to the field_formatter_settings_summary

   Width: 300 px, Height: 30 px, Preload: none
xacto’s picture

Thank 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?

deggertsen’s picture

It appears that the maintainers are not very active. Last commit over 1 year ago...

Dave Reid’s picture

Well, 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.

Poieo’s picture

Status: Needs review » Reviewed & tested by the community

Been working great for me for me.

faqing’s picture

Version: 7.x-1.x-dev » 7.x-1.2

Tested #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).

lyricnz’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

Don't change version. The patch, when/if it is applied, will need to be applied to -dev.

Dave Reid’s picture

Status: Reviewed & tested by the community » Needs review

I'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?

deggertsen’s picture

@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:

Authors might switch the attribute from "none" or "metadata" to "auto" dynamically once the user begins playback. For example, on a page with many videos this might be used to indicate that the many videos are not to be downloaded unless requested, but that once one is requested it is to be downloaded aggressively.

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.

deggertsen’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
7.8 KB

Silly 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.

xacto’s picture

Priority: Normal » Major

Can a maintainer please commit this patch to the dev version?
Thanks!!!

ErwinS’s picture

Patch works fine!
plse commit it...

adam_bear’s picture

Issue summary: View changes

Patch #16 works well- inspired me to make this:

https://github.com/ablank/imediaelement.module

Poieo’s picture

Hey @adam_bear. Since this module is not being maintained, why not apply for co-maintanership and get some of these fixes committed?

adam_bear’s picture

@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.

jordan8037310’s picture

Rerolled #16 against 1.2. Didn't check it against --dev.

  • jordan8037310 authored 2be6c3b on 7.x-1.x
    Issue #1213956 by deggertsen, lyricnz, drewish, Jackinloadup,...
jnettik’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
FileSize
4.49 KB

Updated the patch in #32 to work against dev and committed. This should get ported to the D8 version as well. Updating the issue.

lamp5’s picture

Status: Patch (to be ported) » Needs review
FileSize
2.57 KB

This is patch backported to D8 version.

gbyte’s picture

This is not major.

Re-rolling patch for 8.x-1.x. Please consider commiting as this is in 7.x already.

gbyte’s picture

  • lamp5 authored 94dd929 on 8.x-1.x
    Issue #1213956 by gbyte.co, lamp5, jnettik: Prevent Automatic Download...
jnettik’s picture

Status: Needs review » Fixed

Committed! Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.