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 } ?>