How to use Protected URL for [audio] embed shortcode for mp3 files

I have media protection - Complete on in Membership options and can't figure out how to embed an audio file in a post without the url not being masked... If I view the Page Source of the post, the exact / direct URL to the media file appears multiple times. Perhaps I misunderstand how to use the feature, but I would love love love to be able to embed an audio player in a post and know that someone cannot find the media file url that easily... thanks!

  • Vinod Dalvi

    Hi @Torre Kean,

    I hope you are well today and thank you for your question.

    On the Download / Media Options in the following path you will see the Protected groups field where you can create different protected groups which you can use to group different media files in the media library.

    Admin Area -> Membership -> Options -> Media Tab

    When you upload any media file like mp3 file it is not attached to any Protected content group so you will have to assign it to Protected content group so that access of it can be restricted.

    Then in the access level you can use downloads rules to provide access of these uploaded media based on the Protected content group to the different users.

    You will find more information about usage of this on the following pages.

    https://premium.wpmudev.org/project/membership/#usage
    http://www.youtube.com/watch?v=K9lcyml_g3k&list=PLV1BcivFAIdtF4p7CYVfMbVAJ4JQ1Rpe9&index=7

    Best Regards,
    Vinod Dalvi

  • Torre Kean

    Vinod,

    Thank you for the super fast reply! I may need to clarify my goal:

    I do not want anyone to be able to find the url to my audio files. I have the audio files embedded on pages that are already restricted to members only. I want the members to be able to listen to the audio file, but not to be able to find the file URL.

    In order to protect my content from everyone, I would add it to a protected group that NO ONE has access to, but would that still allow the media player to function for a visitor?

    Thank you!
    Torre

  • Vinod Dalvi

    Hi Torre,

    Thank you for your reply.

    I do not want anyone to be able to find the url to my audio files.

    Then just set the Protection method as Complete protection on the following path

    Admin Area -> Membership -> Options -> Media Tab

    In order to protect my content from everyone, I would add it to a protected group that NO ONE has access to, but would that still allow the media player to function for a visitor?

    Protected media is not accessible for the users who don't have permissions to access it.

    I have not tested using protected media with the media player but you can just test it.

    Regards,
    Vinod Dalvi

  • Torre Kean

    Vinod,

    Thank you, however my question is still not really being answered. For example:

    I have made sure that the mp3 file I am working with is in the 'default' (protected) group.

    I also made sure that I have Complete Protection on in the Options > Media tab.

    Then, I even went into Membership Access Levels and put Downloads - default in the NEGATIVE rules for the Paid Membership access level.

    When I go to the page containing the [audio] player with the .mp3 file in it, I can still right click, hit "Inspect Element", and easily find the un-encoded, direct URL for the mp3 file.

    THIS is what I want to avoid. I want no one to be able to access that URL.

    Thank you for your help,
    Torre

  • Vinod Dalvi

    Hi Torre,

    As i have said in my previous reply that i have not tested it using protected media with any media player as it depends on how the media player retrieves path of the media file.

    If it doesn't work for you then could you please tell me which media player and how you are using it so that i can troubleshoot it.

    Also share me the page link where you are using the media player and if you don't mind if I logged in to your site and did some testing then just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings from the following path and reply on this thread after granting it. This might help get to the bottom of this faster. If this is ok,

    Admin -> WPMU DEV -> Support -> Support Access Tab

    Regards,
    Vinod Dalvi

  • Ella

    Hi All,

    Maybe this is an old topic, but I had the same problem.
    An Apache guru helped me with it. ( I am not that clever)

    - Put a htaccess in the directory that you want to protect.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursitename\.com/ [NC]
    RewriteCond %{REQUEST_URI} !hotlink\.(mp3) [NC]
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
    RewriteRule .*\.(mp3)$ http://yoursitename.com/ [NC]

    In this case:
    Logged in visitors on my site can only listen a Mp3 file.
    When they try to hotlink it (the exact file address) they will be redirected to my homepage.
    So you can only access the file when you are a visitor of my site.

    In this case it was a mp3 but works for any filetype