Page 1 of 2
[Solved] Place Secure Video
Posted:
January 6th, 2012, 12:18 am
by angelazou
Hi,
I'm using S2member to sell some online videos, and I'm using the JWPlayer approach to do it. The following is the code that I'm using in the page
- Code: Select all
<div id="jw-container"></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/Network10.mp4"}},
/* Else, try an HTML5 video tag. */
{type: "html5", provider: "video",
config: {file: "/wp-content/plugins/s2member-files/Network10.mp4"}},
/* Else, this is a safe fallback. */
{type: "download", /* Download the file. */
config: {file: "/wp-content/plugins/s2member-files/Network10.mp4"}}
],
width: 640, height: 480
});
</script>
You can see the page here
http://traynyng.centylyn.com/free-sample-vydeo/ (just replace all the 'y' with 'i'), the player is not loading, though the HTML output seems to be correct.
Angela
Re: Place Secure Video
Posted:
January 6th, 2012, 12:40 am
by Bruce C
Are you just using the standard JWPlayer, or do you have the plugin? Try putting this on your website and see if it plays it better:
http://wordpress.org/extend/plugins/jw- ... wordpress/
Re: Place Secure Video
Posted:
January 6th, 2012, 1:09 am
by angelazou
I installed the plugin, but the player still doesn't show up. Should I use a different code instead?
Re: Place Secure Video
Posted:
January 6th, 2012, 1:18 am
by Bruce C
I would guess there is probably a shortcode for the plugin. Try reading through the settings. It's mostly likely a lot simpler.
Re: Place Secure Video
Posted:
January 7th, 2012, 12:53 am
by drbyte
Check the player URL Path, try absolute path
http://site.com/jwplayer/player.swf/jwplayer/player.swf does not exist on sub or main domain
{type: "flash", provider: "http", src: "/jwplayer/player.swf",
That goes too for /jwplayer/jwplayer.js
Sam
Re: Place Secure Video
Posted:
January 7th, 2012, 1:31 am
by angelazou
This is the shortcode I'm currently using:
- Code: Select all
English Lesson
[jwplayer config=” Training” file=”http://www.centilin.com/wp-content/plugins/s2member-files/Network10.mp4”]
中文课程
[jwplayer config=” Training” file=”http://www.centilin.com/wp-content/plugins/s2member-files/Network10.mp4”]
And the question I have is how does the plugin secures the video from not exposing its address (and therefore preventing user from just typing in the address and not buying the membership)?
Angela
Re: Place Secure Video
Posted:
January 7th, 2012, 1:38 am
by Bruce C
s2Member blocks access tot he s2member-files folder directly, so it's not possible for a user to do that.
Re: Place Secure Video
Posted:
January 7th, 2012, 1:42 am
by drbyte
As long you are using S2member restriction and downloading options, your files will be protected.
The code seems to be OK, you need to look into the JW player plugin and make sure all of the settings are correct.
Most likely because you are using a sub domain, there might be a misconfiguration.
Sam
Re: Place Secure Video
Posted:
January 7th, 2012, 2:24 am
by angelazou
The plugin settings remain the default, I haven't touched that (you can see from the screenshot below). But as you can see from my shortcode, I'm using a custom player configuration called Training. The settings that I have modified (from the default are in the basic settings page).
Edit: could it be a license problem? I'm using the free version now.
Re: Place Secure Video
Posted:
January 7th, 2012, 4:51 am
by xigaogen
If you're running s2Member with mod_deflate for Apache (common on many hosts), you'll want to add this section to the top of your WordPress .htaccess file, so that your installation of Apache will know when it should NOT use GZIP compression.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{THE_REQUEST} (?:(?:^|\?|&)s2member_file_download\=.+|(?:^|/)s2member-files/.+)
RewriteRule ^(.*)$ - [E=no-gzip]
</IfModule>
Re: Place Secure Video
Posted:
January 7th, 2012, 5:00 am
by angelazou
But how does that relates to the issue I have right now?
Edit: the HTACCESS rules caused my site to go down.
Re: Place Secure Video
Posted:
January 7th, 2012, 7:48 am
by angelazou
I wonder if this is really about JWplayer. I mean if it doesn't work out in the end, would S2member be fine if I switched to another video plugin?
Angela
Re: Place Secure Video
Posted:
January 9th, 2012, 2:38 am
by xigaogen
Could you try accessing the URL to the video directly (while you're logged in) to see if it loads? If it doesn't load, then it's not a problem with the player but rather with the s2Member download restrictions. You can also just directly download a txt file instead a video to test it.
If the video loads fine when you access the URL directly in your browser, please try disabling your plugins one-by-one to see if any of those cause the problem to go away (it could be an update to another plugin that started the problem).
Re: Place Secure Video
Posted:
January 9th, 2012, 3:33 am
by angelazou
Well, interestingly enough. The page returned an error message (even with me logged into both sites). The thing is, I'm doing a WPMU set up and this is a subdomain training.centilin.com, whereas the files are located in the path of the main domain
www.centilin.com (so the file would be located in
www.centilin.com/wp-content/plugins/s2m ... xample.mp4). But I was unable to locate that file due to the error message.
Nevertheless, if you visit the page where this occurred (in my first post), the player still doesn't load.
Angela
Re: Place Secure Video
Posted:
January 9th, 2012, 7:25 am
by xigaogen
请用中文说说您遇到的问题。我也遇到放在s2member-files目录下的视频无法播放的问题,但是已经被jason解决了。请参考:http://www.primothemes.com/forums/viewtopic.php?f=4&t=16510&p=59989#p59989
Re: Place Secure Video
Posted:
January 9th, 2012, 9:19 am
by angelazou
Honestly, I mentioned that I had problem directly accessing the file using the absolute path (domain.com/wp-content/plugins/s2member-files/example.mp4), but I later tried with the method mentioned in the configuration page (domain.com/?s2member_file_download=example.mp4), and I can access it without any issues. I think the problem is with the video plugin. I will see what JWPlayer people have to say. Thanks for all the inputs.
Angela
Re: Place Secure Video
Posted:
January 9th, 2012, 11:38 pm
by angelazou
I did some more testing and finally got the video plugin up and running. But here is another problem, the player is having difficulty locating the video file.
Okay, so the absolute path to the video file is
http://www.domain.com/wp-content/plugin ... work10.mp4, but since I'm using a WPMU installation for a subdomain training.domain.com, the path to access it should be training.domain.com/?s2member_file_download=Network10.mp4.
Here are the combinations that I have tried, but failed to get any of them working (and I'm logged in as the admin all the time).
[jwplayer config="Training" file="http://www.centilin.com/wp-content/plugins/s2member-files/Network10.mp4"]
[jwplayer config="Training" file="http://training.centilin.com/?s2member_file_download=Network10.mp4"]
[jwplayer config="Training" file="[s2File rewrite="yes" file="Network10.mp4" /]"]
I did get the videos show up, if they are outside that folder. So, what's the issue here?
Angela
Re: Place Secure Video
Posted:
January 11th, 2012, 1:19 pm
by Raam Dev
Hi Angela,
Please see if this thread helps:
viewtopic.php?f=4&t=16510#p59497
Re: Place Secure Video
Posted:
January 11th, 2012, 11:03 pm
by angelazou
Yes, I tried the HTACCESS rules, but they caused my entire site to go down (and starting to show general errors). I still can access the videos if I use the URLs directly, even with the rewrite URL like 'http://training.centilin.com/?s2member_file_download=Network10.mp4', but once it's in the shortcode, it doesn't work.
Angela
Re: Place Secure Video
Posted:
January 12th, 2012, 5:29 pm
by Raam Dev
Have you tried disabling all your plugins (except s2Member) to see if that fixes the shortcode issue? That sounds like it could be a plugin conflict. You can use
Plugin Organizer to disable all plugins on just one post/page if disabling them site-wide isn't possible.
Re: Place Secure Video
Posted:
January 12th, 2012, 10:17 pm
by angelazou
I did deactivated the other plugins, but it didn't make any difference.
Re: Place Secure Video
Posted:
January 13th, 2012, 4:35 pm
by Raam Dev
Do you have more than one copy of WordPress/s2Member running? In other words, is WordPress/s2Member running on training.domain.com AND domain.com?
Re: Place Secure Video
Posted:
January 13th, 2012, 10:41 pm
by angelazou
Well, I'm using a wordpress multisite installation, but I do not have S2member running on domain.com, only on training.domain.com. But the file system doesn't have an additional folder to hold files for training.domain.com, they are all located in domain.com folder. Hence, the absolute path to the file would be
http://www.domain.com/wp-content/plugin ... s/filename.
I purchased the single site license, but that should gave me the ability to run S2member on all of my subdomains, no?
Angela
PS: or was it the multisite config that I missed? I went back to the main site and enabled S2member (although I'm not selling anything there, and have enabled the patches). However, the videos still didn't show up, just a black box.
I've added a sample testing video in the page that I have mentioned in my previous posts (under secure videos). The first two are using the absolute path, whereas the testing video is using the training.domain.com/?s2member_file_download=filename path.
Re: Place Secure Video
Posted:
January 15th, 2012, 10:17 am
by angelazou
I got it, it was the missing flashvars parameter I'm missing. Can I suggest to update the instructions on the downloads page for the JW Player WP plugin so more people can benefit from it.
Re: Place Secure Video
Posted:
January 16th, 2012, 9:49 pm
by Raam Dev
angelazou wrote:I got it, it was the missing flashvars parameter I'm missing. Can I suggest to update the instructions on the downloads page for the JW Player WP plugin so more people can benefit from it.
Glad to hear you figured it out! Could you explain what you did? Also, which instructions are you referring to?