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.

Some Inline files in bucket work, some don't

Home Forums Community Forum Some Inline files in bucket work, some don't

Tagged: 

This topic contains 2 replies, has 2 voices. Last updated by  Raam Dev 4 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Mar 6th, 2012 at 8:55 pm #7510

I just moved my site to a new hosting service running Apache 2 because I couldn’t get videos to stream from my bucket with Apache 1.
WordPress 3.3.1
s2Member Version 120301 + s2Member Pro v120301
JWPlayer Version 1.5.7

My site is intended to offer streaming-only videos on a rental basis, using the “Buy Now” function, with limited-time access to a specific page containing the video, using custom capabilities. But I’m having trouble getting the video to stream with JW Player.

To test this, I’ve placed a file named “video.mp4” in my Amazon S3 bucket “rockitscience”. Its metadata Content-type is “video/mp4” and Content-Disposition is “inline”.

When I installed JWPlayer, the JWPlayer files were auto-installed in the plugins folder, except for “jwplayer.js” and “player.swf”, which were auto-installed in uploads/jw-player-plugin-for-wordpress/player/.

On the root level of my web site, I added a folder named “jwplayer” containing copies of “jwplayer.js” and “player.swf”, as recommended in the s2Member forum.

If I use this code, the video opens in a new window, so the filepath must be okay, but I’d rather have it embedded in the page with JW Player:

This link uses Advanced Mod-Rewrite Linkage:
<a href="http://rockitscience.com/wordpress/wp-content/plugins/s2member-files/video.mp4">Video.mp4</a>

The code below is the exact code given in s2Member Settings under JW Player® ( RTMP streaming MP4, via s2Member’s Amazon® S3/CloudFront integration ). It was copied and pasted with no changes. But when I view the page, the video player does not appear. All I get is “JW Player appears here.”

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

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Tuesday Mar 6th, 2012 at 11:01 pm #7515

I also found this code on the JW Player site, and it works.

[jwplayer config="video.mp4" file="http://rockitscience.com/wordpress/wp-content/plugins/s2member-files/video.mp4"]

But the longer code in my original question looks like it would work with more browsers because it addresses both Flash and HTML5, so I’d like to be able to use that one, if possible.

Posted: Wednesday Mar 7th, 2012 at 12:30 pm #7553
Raam Dev
Username: Raam
Staff Member

Hi John,

Please try downloading the full JWPlayer from here and uploading all of the files to /jwplayer/.

Viewing 2 replies - 1 through 2 (of 2 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.