Page 1 of 1

Streaming and Downloading Media Questions

PostPosted: October 12th, 2011, 4:39 am
by marcusuk
Hi there,

A client wants to offer both downloading and streaming of a handful of videos.

From having a look at the the forums and tutorials, the streaming part can be handled quite easily via JW Player and Amazon S3, which is very good. :D

The client however; wants to charge different amounts for streaming and different amounts for downloading the same video.

So my understanding is that I would need to create two posts per video. One that protects the download and one that protects the stream. Each of these would then need to be set at a different level, to prevent access to each other.

So on the download options page I would have a two paypal buttons for each video set at different levels.
As the free version can only handle 4 levels. I would need the pro version if I plan on serving more than two videos.

Is this the correct way to go about this. Or are there easier ways? I appreciate your input.

Kind Regards,

Marcus

Re: Streaming and Downloading Media Questions

PostPosted: October 12th, 2011, 5:16 am
by Sim2K
look at this - http://www.s2member.com/custom-capabilities-video/

I think this will HELP a lot.

Re: Streaming and Downloading Media Questions

PostPosted: October 12th, 2011, 5:35 am
by marcusuk
Many Thanks.

Will check it out :)

Re: Streaming and Downloading Media Questions

PostPosted: October 12th, 2011, 10:00 am
by marcusuk
That makes sense now, cheers.

I hust have another query regarding the JW Player / Amazon S3 + Cloudfront.

Using the second example:

JW Player® ( RTMP streaming MP4, via s2Member's Amazon® S3/CloudFront integration )

I am getting a player in the posts. Once clicked, however I am getting stream not found error:

Code: Select all
rtmp://s3is2o9s32f4pz.cloudfront.net/cfx/st", file: "yu5.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoieXU1Lm1wNCIsIkNvbmRpdGlvbiI6eyJJcEFkZHJlc3MiOnsiQVdTOlNvdXJjZUlwIjoiNzguODYuOTQuMTAzLzMyIn0sIkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxMzE4NTE3NzY5fX19XX0_&Signature&Key-Pair-Id=APKAJNVJDTI264JRVAQQ


I have noticed that the signature value is not filled in. Maybe that is the problem? How does this get generated.

Many Thanks,

Marcus

Re: Streaming and Downloading Media Questions

PostPosted: October 12th, 2011, 12:55 pm
by marcusuk
Getting closer I think. Now getting a video not found or access denied.

A quick question though, when I call the below link in the browser. I am getting a missing signature query parameter. Do I need this signature. If So how is it generated?

http://blog.linearsky.com/?s2member_file_inline=yes&type=video&s2member_file_download=/yu5.mp4

Code: Select all
$cfg = array ("file_download" => "http://blog.linearsky.com/?s2member_file_inline=yes&type=video&s2member_file_download=/yu5.mp4", "rtmp://s3is2o9s32f4pz.cloudfront.net:443/cfx/st" => 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"))) { ?>

<?php echo print_r($mp4); ?>
    <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?type=video",
                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: 480
        });
    </script>


Appreciate your input

Kind Regards,

Marcus

Re: Streaming and Downloading Media Questions

PostPosted: October 12th, 2011, 2:55 pm
by marcusuk
Any ideas on this please? I am at a loss.

Should the signature be generated or not from the call below:

Code: Select all
if (($mp4 = s2member_file_download_url($cfg, "get-streamer-array"))) { ?>


$mp4 results in:

Code: Select all
http://blog.linearsky.com/?s2member_file_inline=yes&type=video&s2member_file_download=%2Fyu5.mp4&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2Jsb2cubGluZWFyc2t5LmNvbS8%7EczJtZW1iZXJfZmlsZV9pbmxpbmU9eWVzJnR5cGU9dmlkZW8mczJtZW1iZXJfZmlsZV9kb3dubG9hZD0veXU1Lm1wNCIsIkNvbmRpdGlvbiI6eyJJcEFkZHJlc3MiOnsiQVdTOlNvdXJjZUlwIjoiNzguODYuOTQuMTAzLzMyIn0sIkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxMzE4NTM1NDc3fX19XX0_&Signature&Key-Pair-Id=APKAJNVJDTI264JRVAQQ


I am running the latest version of s2Member - 111011. Or am I chasing shadows with this singature querysting and it has nothing to do with anything?

Re: Streaming and Downloading Media Questions

PostPosted: October 12th, 2011, 3:45 pm
by marcusuk
Anyone got streaming using Amazon S3+cloudfront using JWPlayer to work?

I have followed the JW Player® & RTMP Protocol Examples. Still nothing.

Video not found or access to denied.

Anything clues please. Will love you forever!

Test page:
http://blog.linearsky.com/?p=106
username: marcus.powell
password: wordpress

Re: Streaming and Downloading Media Questions

PostPosted: October 13th, 2011, 1:01 pm
by Jason Caldwell
Hi there. The absence of a Signature is the problem here.

An empty Signature would indicate to me that s2Member's Signature-generation routine is failing on your installation. Here are some things I would have a look at.

1. Is your installation of PHP compiled with OpenSSL support?
2. Is this function working properly on your PHP installation?
http://php.net/manual/en/function.openssl-sign.php

3. Also see s2Member's CloudFront/RSA signature routine here:
viewtopic.php?f=40&t=13012&src_doc_v=111011#src_doc_line_651

If problems persist, try running this against an installation of PHP v5.3.8+, compiled with OpenSSL, just to rule out any possibility of this bug hitting you. http://www.apachelounge.com/viewtopic.php?t=4180 ( https://bugs.php.net/bug.php?id=55439 )

Re: Streaming and Downloading Media Questions

PostPosted: October 13th, 2011, 1:15 pm
by marcusuk
Hi,

Thanks for the reply. It's all working now.

I missed the last - when copying my private key for the cloudfront.

I would of thought it would still have generated a key though? That's why I didn't check that.

Regards,

Marcus

Re: Streaming and Downloading Media Questions

PostPosted: October 13th, 2011, 1:19 pm
by Jason Caldwell
Ah, OK thanks. You're not the first person to report that, so I suppose we should add a validation scan against that key to make sure this doesn't happen to others. Thanks for the feedback on this, much appreciated!

Re: Streaming and Downloading Media Questions

PostPosted: October 13th, 2011, 1:21 pm
by marcusuk
No problem.

It's a great plugin.

Re: Streaming and Downloading Media Questions

PostPosted: October 17th, 2011, 7:23 pm
by Jason Caldwell
s2Member works around this issue starting with v111017+.
~ Thanks for the great feedback.