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.

cloudfront SMIL jwplayer dynamic streaming

Home Forums Community Forum cloudfront SMIL jwplayer dynamic streaming

This topic contains 6 replies, has 4 voices. Last updated by  Warren Cohn 3 years, 5 months ago.

Topic Author Topic
Posted: Sunday Jul 7th, 2013 at 7:41 pm #53096

I have S2Member set up with cloudfront to serve my video files and everything works perfectly.

However, being HD videos. I want to load a lower resolution version for visitors with less bandwidth.

I had hoped it would be as simple as uploading the SMIL file to my S3 bucket and then in the jwplayer shortcode link to that instead of to the mp4 file. However, that did not seem to work. Some stuff I read online for getting it to work with jwplayer implied I would have to change the embed code a bit. Which I presume means I might have to do that within s2member if that is not already supported.

Thanks for any help you can offer.

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Tuesday Jul 9th, 2013 at 6:07 am #53168
Username: Bruce
Staff Member

Thank you for your inquiry.

It sounds like what you’re trying to do is set up HD switching. I can’t say I’m experienced with working with SMIL videos, but I know that you can set up HD switching with multiple different video files of different resolutions, as shown in this example in the JW Player docs:

Will that work okay for you?

Posted: Thursday Jul 11th, 2013 at 4:29 am #53274

Thanks for the response, however I think that is not quite what I need.
JWplayer says that hd switching does not work for RTMP.
What I think need is dynamic streaming as described here.

I am not clear if using in the shortcode file_download=”smil-file-location.smil” is supported or if I need to do something else, or if my cloudfront setup is not correct.

Posted: Thursday Jul 11th, 2013 at 4:27 pm #53316

Your right RTMP switching will only work with a smil file.

However as the videos need to be protected with expiring links the smil has to be generated on the fly i.e it doesn’t exist and only gets created once requested.

This is something I’m currently working on, it seems rather messy and complicated, anyhow I’m going to do it like so:

<div id="myElement"></div>

		playlist: [{
			image: "",
			sources: [{ 
            	file: "path/to/file/smil.php?file_name_720=video-720&file_name_480=/sub-directory/video-480",
            	type: "rtmp"
        width: "100%",
        aspectratio: "16:9",
        primary: "flash",

Notice that the smil file can be a php file as long as you set type to rtmp. As you can see I’m passing some variables with the file name, which i will extract and use as reference for my video file locations.

The smil file:


// GET our file name+location variables 
$vid_720 = htmlspecialchars($_GET["file_name_720"]);
$vid_480 = htmlspecialchars($_GET["file_name_480"]);

// here is my todo section where the function to create the protected urls will be created
// perhaps we can include s2member's url signing files here and do something like

include 'the/s2member/files/we/need/not/sure/which/ones.php';

$signed_url_720 = do_shortcode('[s2File download="' . $vid_720 . '" url_to_storage_source="true" get_streamer_json="true" /]')

$signed_url_480 = do_shortcode('[s2File download="' . $vid_480 . '" url_to_storage_source="true" get_streamer_json="true" /]')

    <meta base="rtmp://" />
      <video src="mp4:<?php echo $signed_url_480 ?>" height="480"  />
      <video src="mp4:<?php echo $signed_url_720 ?>" height="720"  />

Well I’m going to do something along those lines, perhaps someone can chip in if they know what files need to be included to sign the urls or if they can think of a better way

Posted: Thursday Jul 11th, 2013 at 5:14 pm #53318

Great! I feel like I am getting somewhere now.

If you are successful at getting the url signing to work please do update this thread.


Posted: Wednesday Jul 17th, 2013 at 7:12 am #53562

I am also very interested in this.

Thank you!

Posted: Monday Jul 22nd, 2013 at 8:20 pm #53832

Has anyone had any luck with s2member / signing Url’s and cloudfront?

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