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

Video + File Download Restriction

Postby rainleader » April 2nd, 2011, 11:40 pm

Maybe I'm overly ambitious, but shouldn't it be possible to upload a .mov or .mp4 file to the s2Member-files directory and use a video embed plugin (like FV Flowplayer or JW Player) to play it from the s2Member protected URL? If properly configured, this should allow only authenticated users would be allowed to watch the videos. Think that might work?
Last edited by rainleader on April 3rd, 2011, 1:39 am, edited 1 time in total.
User avatar
rainleader
Registered User
Registered User
 
Posts: 22
Joined: March 29, 2011

Re: Video + File Download Restriction

Postby Cristián Lávaque » April 3rd, 2011, 12:00 am

Yes. Some players may have their quirks, but it should be possible.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Video + File Download Restriction

Postby rainleader » April 3rd, 2011, 1:41 am

Well, I gave it a shot using the JW Player plugin for Wordpress and tried with multiple URLs, including the s2member_file_download_key() parameter. It seems like JW Player is just too picky, I might give Flowplayer a shot and will report what happens.
User avatar
rainleader
Registered User
Registered User
 
Posts: 22
Joined: March 29, 2011

Re: Video + File Download Restriction

Postby Jason Caldwell » April 3rd, 2011, 12:30 pm

Yes, this should work; we've run several tests on this.

1. FlowPlayer works fine, nothing special required. [ FlowPlayer ]

2. JW Player. Since the URL to your video is not in a standardized format with s2Member protection applied, JW Player requires an additional parameter: type=video ( and don't forget to urlencode )
Code: Select all
<embed
  flashvars="type=video&file=<?php echo urlencode("http://www.example.com/?s2member_file_download=video.mp4&s2member_file_inline=yes"); ?>"
  allowfullscreen="true"
  allowscripaccess="always"
  src="player.swf"
  width="480"
  height="270"
/>

I should also mention. In all cases, videos/mp3s being played through FlowPlayer/JW Player/etc, should always be served "Inline". So you can just go by the example, and make sure you always pass in: s2member_file_download=your-video.mp4&s2member_file_inline=yes.
~ 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 drbyte » April 4th, 2011, 6:32 am

thank you Jason for this....just another way to have the code in your post


Code: Select all
<embed type="application/x-shockwave-flash" src="http://www.sample/player.swf" style="" id="ply" name="ply" bgcolor="#000000" quality="high" allowfullscreen="true" allownetworking="all" allowscriptaccess="always" flashvars="file=http://www.sample.com/?s2member_file_download=video.flv&s2member_file_inline=yes&type=video&wmode=opaque" height="720" width="480">



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

Re: Video + File Download Restriction

Postby rainleader » April 4th, 2011, 9:44 am

I tried doing this with the JW Player plugin installed and it wasn't parsing the embed code in my posts. I literally copied/pasted it into the HTML view of my post -- am I missing something obvious?
User avatar
rainleader
Registered User
Registered User
 
Posts: 22
Joined: March 29, 2011

Re: Video + File Download Restriction

Postby drbyte » April 4th, 2011, 10:18 am

If you are using JW plugin then you need to add type=video to the flashvars

Go to the JW plugin then to the Advanced Settings tab..scroll all the way to the bottom and you will see
Additional Flashvars add this to the flashvars: filed: type=video


Save and try inserting this short code:

[jwplayer config=”myplayer” file=”http://www.sample.com/?s2member_file_download=video.flv&s2member_file_inline=yes”]

Also..it depends on what browser you use...if IE <9 then you need to embed using the Object tags...

<object classid='clsid:D27CDB6E-AE6D-11cf-96...................</object>

Try using the short code above....make sure you add the flashvars first


Correction: you might need to add & before the type=video
meaning:

&type=video to the JW plugin Flashvars




Try this if all fail:

Add those to the JW Plugin Flashvars:

&s2member_file_inline=yes&type=video

then the short code would be:

[jwplayer config=”myplayer” file=”http://www.sample.com/?s2member_file_download=video.flv”]


If it does not work then it might be that the JW Plugin can't understand the ?s in the url above

Sam


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

Re: Video + File Download Restriction

Postby rainleader » April 5th, 2011, 9:49 am

drbyte wrote:If you are using JW plugin then you need to add type=video to the flashvars

Go to the JW plugin then to the Advanced Settings tab..scroll all the way to the bottom and you will see
Additional Flashvars add this to the flashvars: filed: type=video


Save and try inserting this short code:

[jwplayer config=”myplayer” file=”http://www.sample.com/?s2member_file_download=video.flv&s2member_file_inline=yes”]

Also..it depends on what browser you use...if IE <9 then you need to embed using the Object tags...

<object classid='clsid:D27CDB6E-AE6D-11cf-96...................</object>

Try using the short code above....make sure you add the flashvars first


Correction: you might need to add & before the type=video
meaning:

&type=video to the JW plugin Flashvars




Try this if all fail:

Add those to the JW Plugin Flashvars:

&s2member_file_inline=yes&type=video

then the short code would be:

[jwplayer config=”myplayer” file=”http://www.sample.com/?s2member_file_download=video.flv”]


If it does not work then it might be that the JW Plugin can't understand the ?s in the url above

Sam


Sam


Thanks! Got it working... :)
User avatar
rainleader
Registered User
Registered User
 
Posts: 22
Joined: March 29, 2011

Re: Video + File Download Restriction

Postby cote289 » May 29th, 2011, 4:22 pm

@jason

you mentioned flowplayer works without issue.

can you post the code you used to test flowplayer?

for the life of me i cannot get it to work and have tried many many times.

here is a thread i posted on it
viewtopic.php?f=4&t=6597&hilit=video

appreciate any help you can provide

Ben
User avatar
cote289
Registered User
Registered User
 
Posts: 16
Joined: May 27, 2011

Re: Video + File Download Restriction

Postby Jason Caldwell » May 31st, 2011, 5:55 am

FlowPlayer example code.

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

Code: Select all
<?php
$config 
= "{'clip':{'url':'http://example.com/?s2member_file_download=video.mp4&s2member_file_inline=yes','autoPlay':false,'scaling':'orig'}}";
?>
<embed src="flowplayer.swf" flashvars="config=<?php echo rawurlencode($config); ?>" width="100%" height="400" allowfullscreen="true" type="application/x-shockwave-flash" />
* Just be sure to use rawurlencode(), and NOT just urlencode(). If you can't use PHP, you can use this tool to "escape()" or "encodeURIComponent()" your configuration string ahead of time, and then do everything with pure HTML if you prefer. http://www.linkedresources.com/tools/un ... 0.2b1.html

Reference articles:
http://php.net/manual/en/function.rawurlencode.php
http://www.w3schools.com/jsref/jsref_en ... ponent.asp
~ 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 cote289 » May 31st, 2011, 3:18 pm

Maybe i should take a step back and just ask the basic question of: What is THE easiest way to get a protected video file into a post.

Here's what I want to do:
Have the posts be nonprotected, everyone can read them, but the videos within the post are only available to members with levels 1 and higher. Free members can't view videos.

I've tried flow player, with inline, download key etc and can't get it working
I've now tried JW player and get the same thing, not working

I don't want to get into PHP code and have to use the code only interface as it negates the point of using wordpress to a large degree. I want to keep it as simple as possible.

before i pull my hair out and keep doing down a more confusing path, what is the easiest way to do this?

thanks for all the help

@rainleader, I'd love to hear how you got it working.

Here's what i've tried so far:
flow player test page: http://trulysimpletech.com/2011/05/test-video/
jw test page: http://trulysimpletech.com/2011/05/test-jw-player/

you can log in with this account to test:
username: joblo
password: password123

I have added the flahsvars to the jw player but still get nothing.

all advice is greatly appreciated.

thank you

Ben
User avatar
cote289
Registered User
Registered User
 
Posts: 16
Joined: May 27, 2011

Re: Video + File Download Restriction

Postby Jason Caldwell » May 31st, 2011, 3:43 pm

If you're using the s2Clean theme, you can just use this Shortcode syntax in WordPress:
Code: Select all
[WS-T-Video src="[mp4|flv]" width="100%" height="400" autostart="false" /]

Code: Select all
[WS-T-Video src="http://example.com/?s2member_file_download=video.flv&s2member_file_inline=yes" width="100%" height="400" autostart="false" /]

Otherwise, you might search the WordPress.org plugins repository for a plugin that implements video Shortcodes. Perhaps this one: http://wordpress.org/extend/plugins/vip ... quicktags/
~ 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 cote289 » May 31st, 2011, 6:22 pm

I am using/testing these two plugins so far

flowplayer:
http://foliovision.com/seo-tools/wordpr ... flowplayer
jw player:
http://www.longtailvideo.com/

I like both just fine, but neither work for me in what i'm trying to do.

Here's the code I used for the flowplayer test page: http://trulysimpletech.com/2011/05/test-video/
Code: Select all
nonprotected file
[flowplayer src='http://trulysimpletech.com/videotest/testmovie.mp4']
protected file inline
[flowplayer src='http://trulysimpletech.com/?s2member_file_download=video/testmovie.mp4&s2member_file_inline=yes']
protected file no inline
[flowplayer src='http://trulysimpletech.com/?s2member_file_download=video/testmovie.mp4']


Here's the code i used for the JW test page: http://trulysimpletech.com/2011/05/test-jw-player/
Code: Select all
[jwplayer config=”myplayer” file='http://trulysimpletech.com/videotest/testmovie.mp4']
protected jw inline

[jwplayer config=”myplayer” file=”http://trulysimpletech.com/?s2member_file_download=video/testmovie.mp4&s2member_file_inline=yes”]

protected jw no-inline

[jwplayer config=”myplayer” file=”http://trulysimpletech.com/?s2member_file_download=video/testmovie.mp4”]


Is there another plugin i should look at?

Ben
User avatar
cote289
Registered User
Registered User
 
Posts: 16
Joined: May 27, 2011

Re: Video + File Download Restriction

Postby Jason Caldwell » June 1st, 2011, 1:04 am

I'll run some tests against these plugins asap.
While I'm doing that, I'll just make a note of the following.

* Some plugins and/or themes will convert the & sign into &amp; or &#038;, which could break the "inline" connection to your video inside a Shortcode. Be sure that you're editing in the HTML tab, and if all else fails, try posting your video with RAW HTML. Perhaps using a plugin like this one: http://wordpress.org/extend/plugins/raw-html/
~ 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 StenCade » June 3rd, 2011, 7:42 pm

I've got JW Player working fine. I installed the JW Player Plugin, made a custom player ("my_player") and made sure to put "type=video" (no quotes) in the flashvars section under advanced options. In the s2member download options I made sure to list "mp4" as one of the inline filetypes.

Then in my post I put this shortcode:
Code: Select all
[jwplayer config="my_player" file="http://www.mysite.com/?s2member_file_download=testvideo.mp4" image="http://www.mysite.com/wp-content/uploads/2011/05/stillframe.jpg"]


No problems! If you try and watch the video without being logged in, you see the preview still in the player, but if you hit play you get a bit of an ugly "access denied" message on top of it. But my video pages are protected too so it's not a big deal. I'm using thumbnails on another page for previews.

Now if only I could figure out this whole pseudo-streaming thing...

One odd note: it seems like the JW Plugin sometimes takes a while to save changes or fails to save changes or something.... I don't know what that's about but it always seems to work itself out after a while.
User avatar
StenCade
Registered User
Registered User
 
Posts: 12
Joined: May 31, 2011

Re: Video + File Download Restriction

Postby cdils » July 8th, 2011, 11:05 am

Thanks StenCade for the post - worked perfectly!

Now if I could use the gallery to display thumbnails to all my protected videos, that would be great, but am not having luck with that so far...
User avatar
cdils
Registered User
Registered User
 
Posts: 9
Joined: July 8, 2011

Re: Video + File Download Restriction

Postby flick » July 14th, 2011, 5:26 pm

Hello

I know this thread is primarily about Video restrictions, but as the title also includes 'file download', I was wondering whether it was possible to use S2Members to restrict file downloads by Member access level please?

e.g. Level 1 can access certain file downloads (or videos) but Level 2 can access these and even more?

Thanks in advance :)
User avatar
flick
Registered User
Registered User
 
Posts: 2
Joined: July 14, 2011

Re: Video + File Download Restriction

Postby Cristián Lávaque » July 14th, 2011, 9:35 pm

flick wrote:I know this thread is primarily about Video restrictions, but as the title also includes 'file download', I was wondering whether it was possible to use S2Members to restrict file downloads by Member access level please?

e.g. Level 1 can access certain file downloads (or videos) but Level 2 can access these and even more?


Yes, that's possible. s2Member Levels give incremental access by default, so Level 2 will get access to content for level 2, 1, 0 and guest. Watch this video on s2Member's download protection http://www.s2member.com/file-download-options-video/

I hope that helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Video + File Download Restriction

Postby flick » July 16th, 2011, 11:17 am

It helped a lot, thanks very much Cristián :D

I also used the posts from this thread to setup JWPlayer and it's working very well when viewed using test accounts.
User avatar
flick
Registered User
Registered User
 
Posts: 2
Joined: July 14, 2011

Re: Video + File Download Restriction

Postby Cristián Lávaque » July 16th, 2011, 10:21 pm

That's great. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Video + File Download Restriction

Postby wayne » July 19th, 2011, 8:30 am

Hi
i have a look through this thread, so sorry if i have missed anything. I an working on something similar where mp4's are loading into flowpayer, which are being pupulated by dynamic urls in wordpress. If i hard code the the url <a class="player" href="myDomian.com/video/test.mp4"> it works fine but is not secure. If i upload to the s2member-files and use the link <a class="player" href="http://myDomain.com/?s2member_file_download=test.mp4"> I get an "Stream not found, NetStream.Play.StreamNotFound, clip: '[Clip] 'http://myDomain.com/?s2member_file_download=test.mp4''''" if i try inline like a previous post i get Error: Unterminated string literal?
I have inline set up as mp4 do i need any other settings. I just wan to make sure the mp4 can not be downloaded and kept.

Cheers

wayne
User avatar
wayne
Registered User
Registered User
 
Posts: 5
Joined: July 19, 2011

Re: Video + File Download Restriction

Postby Cristián Lávaque » July 19th, 2011, 11:55 pm

Hi Wayne. Have you searched the forum? search.php?keywords=flowplayer&fid[]=4
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Video + File Download Restriction

Postby wayne » July 20th, 2011, 6:58 am

yes, I have read through this post and tried the options, but cant access mp4 in the secure files. I think it could be to with my custom capabilities?
User avatar
wayne
Registered User
Registered User
 
Posts: 5
Joined: July 19, 2011

Re: Video + File Download Restriction

Postby wayne » July 23rd, 2011, 8:52 pm

Hi Again
I have setlled to have my video files in an unsecure folder for now but have ran into another problem.
I am using flowplayer with overlay then pops up once clicked. The js function works fine when im not logged in. As soon as im logged in the overlay no longer works but the slider still does? this is at the bottom of my page (iknow its not the correct way but couldnt get it to work with registering it in the wp functions? I have alos strippe dou tmy plugins to check. Has anyone else encountered this?

Code: Select all
<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>
<script type="text/javascript" src="http://static.flowplayer.org/js/flowplayer-3.2.6.min.js"></script>
<script src="http://static.flowplayer.org/js/flowplayer.ipad-3.2.2.min.js"></script>
<script>
jQuery(document).ready(function($) {
   
   $(".scrollable").scrollable();

   // setup overlay actions to buttons
   $("a[rel]").overlay({

      // use the Apple effect for overlay
      effect: 'apple',      
      
      expose: '#111',            
      
      onLoad: function(content) {
         // find the player contained inside this overlay and load it
         this.getOverlay().find("a.player").flowplayer(0).load();
      },
      
      onClose: function(content) {
         $f().unload();
      }
   });            
   
   // install flowplayers
   $("a.player").flowplayer("http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf");
   


});
User avatar
wayne
Registered User
Registered User
 
Posts: 5
Joined: July 19, 2011

Re: Video + File Download Restriction

Postby alouder » September 20th, 2011, 10:13 pm

I noticed earlier in this thread a few of you were successful at playing your protected video on JW Player. I'm not having any luck nor do I fully track what steps were taken. Did you need to create the download key for it to play on JW Player? I noticed Jason posted some embed code as well, did anyone use that and if so, where do i put that? I believe I've followed the steps above but have ranged from pushing play and it saying the file is either not found or protected to now pushing play and nothing happens. I think unfortunately I just need someone to walk me through it from beginning to successful end. Thank you!
User avatar
alouder
Registered User
Registered User
 
Posts: 7
Joined: September 20, 2011

Next

Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 4 guests

cron