Page 1 of 1

Video + File Download Restriction

PostPosted: April 2nd, 2011, 11:40 pm
by rainleader
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?

Re: Video + File Download Restriction

PostPosted: April 3rd, 2011, 12:00 am
by Cristián Lávaque
Yes. Some players may have their quirks, but it should be possible.

Re: Video + File Download Restriction

PostPosted: April 3rd, 2011, 1:41 am
by rainleader
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.

Re: Video + File Download Restriction

PostPosted: April 3rd, 2011, 12:30 pm
by Jason Caldwell
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.