PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Video + File Download Restriction

s2Member Plugin. A Membership plugin for WordPress®.

Re: Video + File Download Restriction

Postby drbyte » September 21st, 2011, 4:14 am

Hi

can you please post the code you are using!

Sam
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Video + File Download Restriction

Postby alouder » September 21st, 2011, 11:18 pm

Here is the shortcode: [jwplayer config=”Tutor Player” file=”http://tamu.louderlearn.com/?s2member_file_download=Math141-Session3-091311.mp4”]

And here is the page I'm trying to put this video on: http://tamu.louderlearn.com/video-stream-test/

As you can see, no video appears on the page. Not sure what I'm doing wrong. The JW Player flashvars are: type=video,inline=yes

Thank you!
User avatar
alouder
Registered User
Registered User
 
Posts: 7
Joined: September 20, 2011

Re: Video + File Download Restriction

Postby drbyte » September 22nd, 2011, 12:34 am

Thanks

Basically this

http://tamu.louderlearn.com/?s2member_f ... 091311.mp4

equals to this:

503: Sorry, File Downloads are NOT enabled yet. Please contact Support for assistance. If you are the site owner, please configure: `s2Member -> Download Options -> Basic Download Restrictions`.



Code: Select all
<p><script type="text/javascript">jwplayer("jwplayer-1").setup({flashplayer: "http://tamu.louderlearn.com/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf", width: "640", height: "400", controlbar: "bottom", "config": "”Tutor", playlist: Player”, "file": "”http://tamu.louderlearn.com/?s2member_file_download=Math141-Session3-091311.mp4”", "wmode": "opaque", events: {}, config: "http://tamu.louderlearn.com/wp-content/uploads/jw-player-plugin-for-wordpress/configs/Tutor Player.xml"});</script></p>


A. I am not sure about using ”" in "”http://tamu.louderlearn.com/?s2member_file_download=Math141-Session3-091311.mp4”" but I think It's the JW Player Plugin

B. Try using underscore instead of dash in your media files.

Math141-Session3-091311.mp4
is not recognized in some players

Instead try this

Math141_Session3_091311.mp4

Hope that helps
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Video + File Download Restriction

Postby alouder » September 22nd, 2011, 6:26 pm

Looks like it's working as it should now! Not sure what exactly finally made it work, but I changed the file name to use underscores, I changed the download restrictions, and removed the quotes just as you said. So thank you!

Now the next question is, how do I go about making it play with the download key option? Here is the code I'm using and it isn't working properly. As I understand it, using the download key should allow non-members to view the video (I'm assuming this means everyone even if not logged in). It works when I'm logged in, but when I log out and try it, it gives me the video not found or access denied message. I'm even using the PHP Execution plugin.

[jwplayer file=http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&amp;s2member_file_inline=yes&s2member_file_download_key=<?php echo s2member_file_download_key("http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4"); ?>]

Thanks again.
User avatar
alouder
Registered User
Registered User
 
Posts: 7
Joined: September 20, 2011

Re: Video + File Download Restriction

Postby drbyte » September 22nd, 2011, 10:21 pm

change this

[jwplayer file=http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&amp;s2member_file_inline=yes&s2member_file_download_key=<?php echo s2member_file_download_key("http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4"); ?>]


to this

[jwplayer file=http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&s2member_file_download_key=[s2Key file_download="Math141_Session3_091311.mp4" /]

JW Plugin Code:

[jwplayer config=”Tutor Player” file=”http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&s2member_file_download_key=[s2Key file_download="Math141_Session3_091311.mp4”]

Try to use a friendly name for your custom player from this Tutor Player to this tutorplayer

Sam
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Video + File Download Restriction

Postby alouder » September 23rd, 2011, 12:30 am

Thanks for the info. Neither of these options is working for me. They both seem to end differently. What may be wrong at this point?
User avatar
alouder
Registered User
Registered User
 
Posts: 7
Joined: September 20, 2011

Re: Video + File Download Restriction

Postby alouder » September 23rd, 2011, 12:50 am

When I use the code below, the video plays, but only when I'm logged in. As I mentioned, I'd like for the video to play regardless if the user is logged in or not. Any thoughts on how to do this?

[jwplayer file=http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&s2member_file_download_key=<?php echo s2member_file_download_key(Math141_Session3_091311.mp4); ?>]
User avatar
alouder
Registered User
Registered User
 
Posts: 7
Joined: September 20, 2011

Re: Video + File Download Restriction

Postby drbyte » September 23rd, 2011, 12:57 am

Try this

[jwplayer config=”Tutor Player” file=”http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&s2member_file_download_key=[s2Key file_download="Math141_Session3_091311.mp4”/]]
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Video + File Download Restriction

Postby alouder » September 23rd, 2011, 1:33 am

This doesn't seem to work either.
User avatar
alouder
Registered User
Registered User
 
Posts: 7
Joined: September 20, 2011

Re: Video + File Download Restriction

Postby drbyte » September 23rd, 2011, 7:45 am

You might have the permission misconfigured. double check s2m download restrictions.


The last video you have on that page is missing your domain name but I checked it. it sends you to the membership option page.

<script type="text/javascript">jwplayer("jwplayer-9").setup({flashplayer: "http://tamu.louderlearn.com/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf", width: "640", height: "400", controlbar: "bottom", "file": "Math141_Session3_091311.mp4&#038;s2member_file_download_key=6f5299c3ff2665dda597dbfb444ec585", "wmode": "opaque", events: {}, config: "http://tamu.louderlearn.com/wp-content/uploads/jw-player-plugin-for-wordpress/configs/Tutor Player.xml"});</script>

Sam
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Video + File Download Restriction

Postby alouder » September 23rd, 2011, 12:12 pm

My download restrictions are set to infinite number of downloads for all levels so not sure how that can be the issue.

When I insert this code into the address bar, the video plays on it's own as it should even if I'm not logged in:

http://tamu.louderlearn.com/?s2member_f ... nload_key=<?php echo s2member_file_download_key("Math141_Session3_091311.mp4"); ?>

But then when I put that code into the jwplayer shortcode below, the video doesn't play. I don't get any messages related to this, the jwplayer just keeps spinning as if it wants to play a video, but it's not.

[jwplayer file=http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&s2member_file_download_key=<?php echo s2member_file_download_key("Math141_Session3_091311.mp4"); ?>]

Not sure why it doesn't want to play. You mentioned download restriction settings. What should they be at? If you want to check the code from my page, here's what it looks like:

<script type="text/javascript">jwplayer("jwplayer-5").setup({flashplayer: "http://tamu.louderlearn.com/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf", width: "640", height: "400", controlbar: "bottom", "file": "http://tamu.louderlearn.com/?s2member_file_download=Math141_Session3_091311.mp4&#038;s2member_file_download_key=df831c51920006052ba300766449e992", "wmode": "opaque", events: {}, config: "http://tamu.louderlearn.com/wp-content/uploads/jw-player-plugin-for-wordpress/configs/tutorplayer.xml"});</script>
User avatar
alouder
Registered User
Registered User
 
Posts: 7
Joined: September 20, 2011

Re: Video + File Download Restriction

Postby tripleaaadelay » December 5th, 2011, 9:22 pm

alouder, did you find a solution with using the key?

Two additional Video + File Download questions:

-Can video + file download restrictions be used with playlists too, and if so, what should the folder structure look like...where should my playlist file go and where should my video folder go?

-If we are adding .mp4 to the "okay" list, what's stopping someone from directly downloading the mp4 files? I only want members streaming mp4s, not downloading them.

This thread has been a big help. Thanks!
User avatar
tripleaaadelay
Registered User
Registered User
 
Posts: 42
Joined: August 17, 2011

Re: Video + File Download Restriction

Postby merchant » January 7th, 2012, 4:42 pm

Jason,
You mention that if you use s2CleanTheme then the embedding of code for playing videos in protected directories is very straightforward.
Is that true? I have not installed the s2CleanTheme.
I am struggling to get the videos to play on using the JWPlayer plugin. I have done all the research on this and other posts and tried several options with no luck. It says access denied.
I am trying to do
1. Embed the video inline for viewing and
2. Want to display a playlist for inline viewing.

Want to store the videos in the protected directories of s2member by different levels.
Any help you can provide would be appreciated.
Is there a video that shows us how to do this?
Will this problem be solved if I use the CleanTheme?
User avatar
merchant
Registered User
Registered User
 
Posts: 45
Joined: October 9, 2011

Re: Video + File Download Restriction

Postby Jason Caldwell » January 9th, 2012, 6:51 am

Thanks for the follow-up.

Yes, the s2Clean theme includes a Shortcode [WS-T-Video /], which makes it possible to quickly embed videos into a Post/Page or even into a Text Widget. This includes the ability to embed videos protected by s2Member. However, the s2Clean theme is not required to accomplish this.

Example #1 with the s2Clean Theme.
Code: Select all
[WS-T-Video src="http://example.com/wp-content/plugins/s2member-files/s2member-file-inline/video.mp4" width="100%" height="400" autostart="false" /]

Example #2 with JW Player.
Code: Select all
<div id="jw-container">JW Player® appears here.</div>
<
script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
<script type="text/javascript">
    jwplayer("jw-container").setup({modes: /* JW Player®. */
    [
        /* First try psuedo-streaming with Flash® player. */
        {type: "flash", provider: "http", src: "/jwplayer/player.swf",
            config: {file: "/wp-content/plugins/s2member-files/s2member-file-inline/video.mp4"}},
            /* Shortcode equivalent: [s2File rewrite="yes" inline="yes" download="video.mp4" /] */
    
        /* Else, try an HTML5 video tag. */
        {type: "html5", provider: "video",
            config: {file: "/wp-content/plugins/s2member-files/s2member-file-inline/video.mp4"}},
            /* Shortcode equivalent: [s2File rewrite="yes" inline="yes" download="video.mp4" /] */
    
        /* Else, this is a safe fallback. */
        {type: "download", /* Download the file. */
            config: {file: "/wp-content/plugins/s2member-files/s2member-file-inline/video.mp4"}}
            /* Shortcode equivalent: [s2File rewrite="yes" inline="yes" download="video.mp4" /] */
    ],
    /* Set video dimensions. */ width: 480, height: 270
    });
</script>
Integration with JW Player can be simplified with a Shortcode, by getting this plugin. See: http://wordpress.org/extend/plugins/jw- ... wordpress/

Of course, you can present protected videos in other players also. Just be sure to use the advanced Mod Rewrite method of linking to protected files, because the ?s2member_file_download=video.mp4 method causes trouble in some media playback devices. Using the direct Mod Rewrite Linkage (made possible by s2Member), will avoid these issues. This is documented in your Dashboard. For further details, I would suggest these sections of your Dashboard with s2Member installed.

s2Member -> Download Options -> JW Player Examples
s2Member -> Download Options -> Advanced Mod Rewrite Linkage
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Video + File Download Restriction

Postby merchant » January 9th, 2012, 6:58 am

Thanks Jason for your detailed reply. How about playlists? Is the playlists functionality pretty much the same as in the other themes or is there a better way for that as well?
Now if I have created my site using a non-s2CleanTheme can I just install it and not have to redo all my work or will I have to significantly redo my work?
User avatar
merchant
Registered User
Registered User
 
Posts: 45
Joined: October 9, 2011

Re: Video + File Download Restriction

Postby Jason Caldwell » January 9th, 2012, 7:08 am

The JW Player plugin includes support for playlists, so that's my recommendation.
http://wordpress.org/extend/plugins/jw- ... wordpress/
I've used this in the past and it works nicely.

The s2Clean Theme does not support playlists.

Converting to the s2Clean theme will likely cause you extra work. A theme dictates the presentation of your content. If you've already started with another theme, I would stick with it to reduce your workload.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Video + File Download Restriction

Postby merchant » January 9th, 2012, 6:18 pm

Thanks Jason, is there any plan to support playlists in the future? That way I can stick with s2Member theme and plugin all the way.
Also does it mean that the method we have discussed for playlists (advanced mod/re-write linkage) will that work with s2Clean? Is the external media url method and the playlist creation available in s2Clean?
I take it subsequent upgrades will be seamless as Wordpress is upgraded so will your theme that way I rather bite the bullet now and not have to rework much more later.
I take it most of the wordpress plugins will also work with your theme?
User avatar
merchant
Registered User
Registered User
 
Posts: 45
Joined: October 9, 2011

Re: Video + File Download Restriction

Postby MediocreFred » January 13th, 2012, 8:21 am

I apologize for hijacking this thread... I am having a very similar issue. Using the WP JW Player plugin. Am trying to use the Advanced Mod Rewrite method to build my url. How do I include the code to build the key?

The example I'd like to use is this -
Code: Select all
... /wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-xS54df5ER4d5x/example-file.zip


How do I include the equivalent of
Code: Select all
<?php echo s2member_file_download_key("example-file.zip"); ?>
in place of "xS54df5ER4d5x" in the above example?

My goal is to allow members (some free, some paid) to play/watch audio and video clips but not be able to broadcast the links willy-nilly.

Thanks.
User avatar
MediocreFred
Registered User
Registered User
 
Posts: 10
Joined: November 21, 2011

Re: Video + File Download Restriction

Postby MediocreFred » January 13th, 2012, 9:57 am

Continuing the previous post, here is an example...

This works:
Code: Select all
[jwplayer file="http://www.rasika.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/test.mp3"]


This does not:
Code: Select all
[jwplayer file="http://www.rasika.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-[s2Key file_download='test.mp3' /]/test.mp3"]


How do I generate the key inline?

Thanks.
User avatar
MediocreFred
Registered User
Registered User
 
Posts: 10
Joined: November 21, 2011

Re: Video + File Download Restriction

Postby merchant » January 13th, 2012, 5:12 pm

for free videos you can use something like this
http://www.yourdomain.com/wp/?s2member_ ... /video.mp4

For premium videos
http://www.yourdomain.com/wp/?s2member_ ... /video.mp4

Now you do not need to include the JWPlayer as you are not embedding the video right you want them to download it ?

So the premium videos would be under the protected level and the free ones would not.

You can also use
"http://mywebsite.com/s2t/wp-content/plugins/s2member-files/s2member-file-inline/access-s2member-level2/videofile.mp4"
User avatar
merchant
Registered User
Registered User
 
Posts: 45
Joined: October 9, 2011

Re: Video + File Download Restriction

Postby MediocreFred » January 13th, 2012, 5:54 pm

Yes, I have the JW Player and the WP JW Player plugin installed.

For both free and paid, I only want content played embedded. I'd like to block downloads - at least for free members.

The URLs you have won't block people from sharing the url. That is the reason why I specifically want to use the download-key feature.

I have the jwplayer shortcode working without the key. All I want is a way to include the dynamically generated key as described in the Rewrite URL documentation.

Thanks.
User avatar
MediocreFred
Registered User
Registered User
 
Posts: 10
Joined: November 21, 2011

Re: Video On Overlay + File Download Restriction

Postby weseoin » January 14th, 2012, 5:51 am

Jason Caldwell wrote:With FlowPlayer, all videos require a FlashVar configuration, and with s2Member it's the same.

Jason,

Can you suggest any tips on showing s2member-restricted video with FlowPlayer on an *overlay*? I want to display my videos 960x540, but the space in my WordPress post can accommodate no more than 620 width. This is the reason I need the overlay.

FlowPlayer does give the jquery script for overlay, but I am not sure this will work with s2member download restrictions.

Any help will be greatly appreciated.
User avatar
weseoin
Registered User
Registered User
 
Posts: 21
Joined: December 3, 2011

Re: Video + File Download Restriction

Postby MediocreFred » January 14th, 2012, 10:34 am

Just in case anybody else is looking to include the Download Key in the URL, here's what I did:

Added this to my custom functions.php file:
Code: Select all
function play_audio( $atts ) {
   extract( shortcode_atts( array('audiofile' => '', 'player' => 'AudioPlayer'), $atts ) );
   if ($audiofile != "") {
      $rkey = s2member_file_download_key($audiofile);
      $rfile = "http://www.mydomain.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-".$rkey."/".$audiofile;
      return jwplayer_tag_callback('[jwplayer config='.$player.' file='.$rfile.']');
   }
   else
      return '';
}
add_shortcode('raudio', 'play_audio');


Within any post or page, I use the shortcode to embed JW Player:
Code: Select all
[raudio audiofile="test.mp3"]


If there's a better/simpler way of doing this, please let me know. If not, hope this helps somebody down the road.

Thanks.
User avatar
MediocreFred
Registered User
Registered User
 
Posts: 10
Joined: November 21, 2011

Re: Video + File Download Restriction

Postby Jason Caldwell » January 14th, 2012, 9:09 pm

So sorry, it looks like I've fallen behind on this thread.
Let me start here by explaining.


MediocreFred wrote:Continuing the previous post, here is an example...

This works:
Code: Select all
[jwplayer file="http://www.rasika.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/test.mp3"]


This does not:
Code: Select all
[jwplayer file="http://www.rasika.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-[s2Key file_download='test.mp3' /]/test.mp3"]


How do I generate the key inline?

Thanks.
Correct, this will not work because WordPress can't parse a Shortcode that's embedded into another Shortcode. If you need to generate a File Download Key with s2Member, and place that File Download Key into yet another Shortcode, you will be forced to use the PHP version of s2Member's Download Key generator. So for instance, you might have this...
Code: Select all
[jwplayer file="http://www.rasika.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-<?php echo s2member_file_download_key("test.mp3"); ?>/test.mp3"]
In order for this to work, you will need to have a PHP Execution plugin installed as well, so that PHP tags <?php ?> are parsed inside your Posts/Pages. See: http://wordpress.org/extend/plugins/exec-php/
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Video + File Download Restriction

Postby Jason Caldwell » January 14th, 2012, 9:11 pm

I like this solution also. For advanced site owners, this will certainly do the job.
MediocreFred wrote:Just in case anybody else is looking to include the Download Key in the URL, here's what I did:

Added this to my custom functions.php file:
Code: Select all
function play_audio( $atts ) {
   extract( shortcode_atts( array('audiofile' => '', 'player' => 'AudioPlayer'), $atts ) );
   if ($audiofile != "") {
      $rkey = s2member_file_download_key($audiofile);
      $rfile = "http://www.mydomain.org/wp-content/plugins/s2member-files/s2member-file-inline-yes/s2member-file-download-key-".$rkey."/".$audiofile;
      return jwplayer_tag_callback('[jwplayer config='.$player.' file='.$rfile.']');
   }
   else
      return '';
}
add_shortcode('raudio', 'play_audio');


Within any post or page, I use the shortcode to embed JW Player:
Code: Select all
[raudio audiofile="test.mp3"]


If there's a better/simpler way of doing this, please let me know. If not, hope this helps somebody down the road.

Thanks.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

PreviousNext

Return to s2Member Plugin

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests

cron