Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-15T19:34:24-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16272 2011-12-15T19:34:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16272&p=56620#p56620 <![CDATA[Re: Download Options example with playlist?]]> Thanks for your inquiry.
This code sample that you posted seems to have gotten corrupted.
You can find full valid code samples inside your Dashboard, under:
s2Member -> Download Options -> JW Player Examples

In this valid example code below, you will just need to change the file name of the video. So swap out video.mp4 with the name of your video, and swap /jwplayer/player.swf with the actual location of JW Player on your site.
Code:
[HR][/HR]<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: 480, height: 270
        });
    </script>

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



<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"]; ?>"}},


Reference articles that might be of some assistance:
http://wordpress.org/extend/plugins/jw- ... wordpress/
http://www.longtailvideo.com/support/jw ... -reference
http://www.longtailvideo.com/support/jw ... the-player

Statistics: Posted by Jason Caldwell — December 15th, 2011, 7:34 pm


]]>
2011-12-09T03:39:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16272&p=56138#p56138 <![CDATA[Download Options example with playlist?]]>
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:
<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 } ?>

Statistics: Posted by tripleaaadelay — December 9th, 2011, 3:39 am


]]>