Hi guys,
I’m getting the Stream Not Found’ error code and I can’t figure out where I’m going wrong. I’ve uploaded Jason’s test video (video.mp4) to my S3 bucket and am using the following code, which I grabbed from the suggested codes S2Member offers. It’s the same code as shown in the AmazonS3/cloudfront/JWPlayer tutorial video.
So I need to change any of the rest of the code? For example, do I need to put my path in there somewhere? Should I put it before the video.mp4 file like this
<?php $cfg = array ("file_download" => "muS3URL/video.mp4", "url_to_storage_source" => true, "count_against_user" => true); ?>
Do I need to change my permissions on the files in S3 to ‘everyone’ in order for people to be able to view these files when they access the paid part of my site?
Any guidance would be appreciated as I’m not a programmer. I’ve read through other people’s issues with this and found the following discuss, which was very interesting but I think/hope my issue is simpler than this. http://www.s2member.com/forums/topic/cloudfront-and-rtmp-streaming-jw/page/2/
Here’s the code I’m using:
<div id="jw-container">JW Player® appears here.</div>
<script type="text/javascript" src="/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" => "video.mp4", "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: "/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: 900, height: 514
});
</script>
<?php } else /* Access is denied to the current User. */ { ?>
Sorry, you do NOT have access to this file.
<?php } ?>
Also, Jason gave someone a really good looking code that seems to have more specific references to Amazon S3. I tried this one as well, but no luck. Here it is:
<div id="jw-container">JW Player® appears here.</div>
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
<?php
/* A direct URL to the CloudFront RTMP source; counting the file against the current User in real-time. */
$mp4_via_cf_cfg = array ("file_storage" => "cf", "file_download" => "video.mp4", "url_to_storage_source" => true, "count_against_user" => true);
/* A direct URL to the Amazon S3 source; NOT counting this variation against the current User. */
$mp4_via_s3_cfg = array ("file_storage" => "s3", "file_download" => "video.mp4", "url_to_storage_source" => true);
/* API Function `s2member_file_download_url()` returns false if access is denied to the current User. */
if (($mp4_via_cf = s2member_file_download_url ($mp4_via_cf_cfg, "get-streamer-array")) && ($mp4_via_s3["url"] = s2member_file_download_url ($mp4_via_s3_cfg))) {
?>
<script type="text/javascript">
jwplayer("jw-container").setup({modes: /* JW Player®. */
[
/* First try real-time streaming with Flash® player. */
{type: "flash", provider: "rtmp", src: "/jwplayer/player.swf",
config: {streamer: "<?php echo $mp4_via_cf["streamer"]; ?>", file: "<?php echo $mp4_via_cf["file"]; ?>"}},
/* Else, try an HTML5 video tag with the `mp4` file. */
{type: "html5", provider: "video",
config: {file: "<?php echo $mp4_via_s3["url"]; ?>"}},
/* Else, this is a safe fallback. */
{type: "download", /* Download the file. */
config: {file: "<?php echo $mp4_via_s3["url"]; ?>"}}
],
/* Set video dimensions. */ width: 480, height: 270
});
</script>
<?php } else /* Access is denied to the current User. */ { ?>
Sorry, you do NOT have access to this file.
<?php } ?>
Any suggestions??
Thanks in advance!!