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.
Thanks for the brilliant module to make the player completely accessible by keyboard.
Currently the JS library turns all of the relevant links into player. It would be great if we can allow user to choose which link need to be converted into player and leave other links as default.
Patch coming.
Comment | File | Size | Author |
---|---|---|---|
#12 | nomensa_amp-option_to_convert-2035311-12.patch | 2.11 KB | rli |
Comments
Comment #1
rliThis patch altered the default jquery.loader.js file to receive parameter from the UI.
User can set class name in configuration page, and the JS will only convert the links with same class name into the media player, which gives user more control of this feature.
Comment #2
rlifix some words and add feature to all kinds of media links.
Comment #3
opdaviesThanks for the patch. Just to clarify, I no longer work for Nomensa, so I wouldn't feel right making any further changes to the module without their prior approval. I've sent an email so hopefully I or someone else will be committing your patch soon.
In the meantime, I will review the patch on my own site and report back.
Comment #4
danghoaiphuc CreditAttribution: danghoaiphuc commentedYes, thanks for a great module, especially for non-tech people like me. What do you think if we can have a feature as a block to show the player and file links are still kept as they are. I am helping a library site for the blind users and they prefer to download the files instead of streaming online. However, they would like to have a player to help them hear a bit of the file before downloading. I am using screen reader and cannot find the link to download when enable the module.
For the moment, if you have any ideas on how to customize the code to add this option, please help. Thanks
Comment #5
opdavies@danghoaiphuc, it all depends in what way you're using the player. If you're using it to stream YouTube videos, then you won't be able to download them. Please create a new issue for this, using the feature request category.
Thanks.
Comment #6
rli@danghoaiphuc, this patch can give you the choice to have a player and download link by assigning the class to the link. But like @opdavies said, it depends on the source. It won't be downloadable if it is youtube video.
Comment #7
danghoaiphuc CreditAttribution: danghoaiphuc commentedThanks @opdavies and @rli. Will post a new feature request. Our file host is on 4shared.com and wee have the direct links to download files from there. So we just copy those direct download links from 4shared and paste into our website. If so, does it work with your patch, @rli? Thanks.
Comment #8
rli@danghoaiphuc, If your path is like 'http://4share.com/test.mp4', the player will be able to pick it up. To make it available for the player, you will need to put a link like
<a class='your class' href='http://4share.com/test.mp4'>test</a>
. Any links without your class name will be just a normal link to the file.Comment #9
Stephen OllmanWorks beautifully for D7.
Is there a D6 version of the patch?
Comment #11
opdavies@rli: I've committed the patch to 7.x-1.x, and fixed an "undefined index" notice that was appearing if the admin form hadn't been submitted so the class name wasn't defined.
However, if I add a class of "player3" rather than just "player", the player still loads. Setting it to something else like "foo" (that doesn't have "player" in it) prevents the player from loading.
Comment #12
rliHi opdavies,
I have done following changes:
Cheers
Comment #13
opdaviesComment #14
opdaviesCommitted. Thanks!
Comment #15
opdaviesComment #17
opdavies@rli: Would it be possible to change this around, and add a class of .no-player instead to prevent the player from loading rather than the other way around? The inverse way means that sites currently using the module won't all suddenly stop working, and we're not deviating away from the standard functionality of the player.
Comment #18
rliAgreed, it would be hard to manage the code when nomensa library is updated. Better to leave nomensa lib untouched and we do the magic in the module. Will think about it.
Comment #19
opdaviesComment #21
joachim CreditAttribution: joachim commentedIt looks like this is replacing the JS file from the NomensaAMP library with a copy that is now in this module.
I assume the reason for this is that the module's copy differs from the NomensaAMP library version.
This approach strikes me as a very bad idea.
Comment #23
opdaviesThanks for pointing this out, and I agree completely. Two commits for this were causing #2389975: Javascript breaks across site in latest version, so are no longer present in the 7.x-1.4 release.
Any changes to the player functionality should be made upstream by forking the media player repository on GitHub and submitting a pull request, so I'm marking this issue as "works as designed". An issue can then be created here to update the version of the player to use when needed.