I'm looking at the "JW Player® ( RTMP streaming MP4, via s2Member's Amazon® S3/CloudFront integration )" configuration. Is the code in RED what I should be replacing with my specifics? Can you give me an example of how I would adjust this code?
Also, how can I use this code with a playlist instead of an mp4?
Thx!
Code below:
- Code: Select all
<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 ("[color=#FF0000]file_download[/color]" => "[color=#FF0000]video.mp4[/color]", "[color=#FF0000]url_to_storage_source[/color]" => true, "[color=#FF0000]count_against_user[/color]" => 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, "[color=#FF0000]get-streamer-array[/color]"))) { ?>
<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["[color=#FF0000]streamer[/color]"]; ?>", file: "<?php echo $mp4["[color=#FF0000]file[/color]"]; ?>"}},
/* Else, try an HTML5 video tag. */
{type: "html5", provider: "video",
config: {file: "<?php echo $mp4["[color=#FF0000]url[/color]"]; ?>"}},
/* Else, this is a safe fallback. */
{type: "download", /* Download the file. */
config: {file: "<?php echo $mp4["[color=#FF0000]url[/color]"]; ?>"}}
],
/* 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 } ?>