latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Video won't play on Membership Option Page

Home Forums Community Forum Video won't play on Membership Option Page

This topic contains 3 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years, 5 months ago.

Topic Author Topic
Posted: Thursday Aug 9th, 2012 at 4:03 pm #21659
Echomango
Username: echomango

This has got to be a newb error…I have a video configured and playing just fine using JWPlayer and s3/cloud but when I try to use the same code to have that be a video introduction on the membership option page it will play as long as I am logged in but as soon as I log out it won’t play. It will play for other logged in users but not for any user that is not logged in. When logging out the text remains on the page but the vid won’t play. :>(

Can someone please set this newb straight? I’ve tried everything I can think of and have searched the forums but no answers. ugh.

I will paste in the code that is working for those logged in but not for the general public:

Thank you.

Echo

<?php
// Configuration.
$s2_jw_config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
$s2_jw_config["mp4_video_file_name"] = "intro-555b.mp4"; // Name of your MP4 test file.
// Don't edit anything else below unless you know what you're doing.
?>

<div id="jw-container">JW Player® appears here.</div>
<script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>

<?php /* A direct URL to the RTMP source; counting the file against the current User in real-time. */
$cfg = array ("file_download" => $s2_jw_config["mp4_video_file_name"], "url_to_storage_source" => true, "count_against_user" => true); ?>

<?php /* API Function `s2member_file_download_url()` returns false if access is denied to the current User. */
if (($mp4 = s2member_file_download_url ($cfg, "get-streamer-array"))) { ?>

    <script type="text/javascript">
        jwplayer("jw-container").setup({modes: /* JW Player®. */
        [
            /* First try real-time streaming with Flash® player. */
            {type: "flash", provider: "rtmp", src: "<?php echo $s2_jw_config["jwplayer"]; ?>player.swf",
                config: {streamer: "<?php echo $mp4["streamer"]; ?>", file: "<?php echo $mp4["file"]; ?>"}},
        
            /* Else, try an HTML5 video tag. */
            {type: "html5", provider: "video",
                config: {file: "<?php echo $mp4["url"]; ?>"}},
        
            /* Else, this is a safe fallback. */
            {type: "download", /* Download the file. */
                config: {file: "<?php echo $mp4["url"]; ?>"}}
        ],
        /* Set video dimensions. */ width: 640, height: 360
        });
    </script>

<?php } else /* Access is denied to the current User. */ { ?>
    Sorry, you do NOT have access to this file.
<?php } ?>

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Friday Aug 10th, 2012 at 6:57 am #21696

Hi Echo.

If it’s a protected file, a logged out user won’t have access to it. If you need to play a video for visitors, then put it in a bucket that isn’t integrated to s2Member for protection.

I hope that helps. :)

Posted: Friday Aug 10th, 2012 at 10:16 am #21714
Echomango
Username: echomango

Many thanks Cristián! That did the trick. I love it when it is simple! Thanks so much.

Echo

Posted: Saturday Aug 11th, 2012 at 2:42 am #21750

Great! :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.