Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › eMember – serve snippet of video to non-logged in users, full video to members?
- This topic has 7 replies, 2 voices, and was last updated 12 years, 4 months ago by bradelectro.
-
AuthorPosts
-
July 9, 2012 at 7:06 pm #6842bradelectroMember
I don’t think this is possible, but I have to check. Is there a way to serve just a snippet of a video, i.e. 2 minutes from a 30 minute MP4, to non-paying members; and then serve the entire video to the paying members?
The way I have it set up now is two different clips for each video= 2 different posts for 2 different levels of membership (free and premium). This works just fine but I need to know if the method I describe above is possible.
Thanks!
July 10, 2012 at 7:09 am #47135adminKeymastereMember doesn’t do this directly. This is something that will need to be handled in your video player. Some video players let you embed a video for upto XX minutes. What you can do is customize it so you limit the video playback time if the user is not logged in. This post has example code snippets to find out if a member is logged in or not:
http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248
July 14, 2012 at 8:19 pm #47136bradelectroMemberThanks for the helpful reply. You wouldn’t happen to know of a video player that stops the playhead after a certan point, would you? I’ve been searching but no luck.
July 16, 2012 at 3:56 pm #47137bradelectroMember^^^Scratch that question above, I’m going to go the conditional blocks route you recommended. I’d like your opinion on my method, please. First, I installed a plug-in that allows me to place php in posts. Then, I put this in a post using the HTML editor:
[php]<?php if(!wp_emember_is_member_logged_in()) { ?>[/php]***embedded YouTube video***[php]<?php } ?>[/php]
[php]<?php if(wp_emember_is_member_logged_in()) { ?>[/php]
[video mp4="http://mydomain.s3.amazonaws.com/my-video.mp4" width="640" height="480" preload="auto"]
Download this entire video in MP4 format – perfect for your iPad, iPhone or your PC/Mac.
[wp_eStore_add_to_cart id=3]
[php]<?php } ?>[/php]Are their any security issues that I should be aware of? Will non-logged in members be able to view source and get the S3 video link from the code? Also, is there really not a way to do this out-of-the-box? I would think this type of functionality would be built in, i.e. a custom fields box (or something similiar) to serve content to logged-in members, and then another for non-logged-in members content. Right now the only other way to do this that I know of is to create two posts for each type of member…
Anyway, Please let me know if I’m doing this right. Thanks!
July 16, 2012 at 11:42 pm #47138adminKeymasterWhat you did is correct. There is no security issue with that because when the page renders it won’t even render the other block if the user is not logged into the site.
Anyway, there is a slightly easier way to do this which is the built in method. This method will give you more flexibility and you won’t have to worry about any PHP code. Please read this documentation:
http://www.tipsandtricks-hq.com/wordpress-membership/how-to-protect-a-section-of-a-post-or-page-88
July 18, 2012 at 12:38 am #47139bradelectroMemberNice to know about the shortcodes, thanks. I replaced my PHP with your shortcodes and the non-logged in content works, but the logged in content shows the code, i.e. the HTML. Here is the code I have in the HTML post editor:
[emember_protected scope=not_logged_in_users_only]
<iframe src="http://www.youtube.com/embed/kLXwgJOgpz4" frameborder="0" width="640" height="360"></iframe>
A 10 minute FitMamaTV workout. To view the entire video, <a href="http://www.fitmamatv.com/join-us/">join</a> today!
[wpfp-link]
[/emember_protected]
[emember_protected]
[video mp4="http://fitmamatv.s3.amazonaws.com/CoreMama%20-%2010m%20PRE%20Beg.mp4" width="640" height="480" preload="auto"]
Download this entire video in MP4 format – perfect for your iPad, iPhone or your PC/Mac.
[wp_eStore_add_to_cart id=x]
[wpfp-link]
[/emember_protected]Here is what that renders: http://screencast.com/t/Ree54jDqBJ. I took out the other shortcodes just to see if they were interfering but that wasn’t the issue. Is there something I’m overlooking? Thanks!
July 18, 2012 at 8:23 am #47140adminKeymasterYou are using another shortcode inside those section protection shortcode so there is a bit of shortcode nesting issue going on. This post will help you:
July 18, 2012 at 5:56 pm #47141bradelectroMemberYes! Topic closed! Thank you for your time and patience.
-
AuthorPosts
- You must be logged in to reply to this topic.