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.

trouble streaming a jwplayer playlist

Home Forums Community Forum trouble streaming a jwplayer playlist

Tagged: 

This topic contains 25 replies, has 3 voices. Last updated by  Echomango 4 years, 5 months ago.

Topic Author Topic
Posted: Friday Jul 27th, 2012 at 2:36 pm #20423
Echomango
Username: echomango

I am able to stream a single video from my cloudfront account just fine. Lately I have been trying to get a playlist working and with the help of the longtail forum have gotten it to the point where the error is “stream not found” This seems to say that things are configured ok until it looks for the stream and it can’t find the video. I was hoping that someone here might have some feedback on this. I will paste in a small part of the playlist code. Any help would be much appreciated.

Thanks

{
'file': 'sunset5555.mp4',
'title': 'Third One',
'streamer': 'rtmp://s1rk84swrux2iq.cloudfront.net/cfx/st',
'provider': 'rtmp',
'duration': '653.79',
'description': 'And here is the third one.And here is the third one.'
}
]
});
</script>

List Of Topic Replies

Viewing 25 replies - 1 through 25 (of 25 total)
Author Replies
Author Replies
Posted: Friday Jul 27th, 2012 at 4:44 pm #20442

Can you post the full code your using please

Posted: Friday Jul 27th, 2012 at 4:51 pm #20444
Echomango
Username: echomango

Hi Philly – Thanks for responding. btw, I have learned a good deal from reading your posts. Thanks for that.

I should have posted the entirety from the start. My bad.

Echo

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

<div id='jwplayer'>This text will be replaced now</div>

<script type="text/javascript">
jwplayer('jwplayer').setup({
'flashplayer': 'http://thewaymenheal.com/jwplayer/player.swf',
'id': 'playerID',
'width': '650',
'height': '240',
'playlist.thumbs': 'false',
'playlist.position': 'right',
'playlist.size': '250',
'playlist': [
{
'file': 'menandgrief2.mp4',
'title': 'First One',
'provider': 'rtmp',
'streamer': 'rtmp://s1rk84swrux2iq.cloudfront.net/cfx/st',
'image': '/wp-content/uploads/thumbnailwindowslivewriter.jpg',
'duration': '290.03',
'description': 'Yep, this is the first one.'
},
{
'file': 'menandgrief3.mp4',
'title': 'Second One',
'streamer': 'rtmp://s1rk84swrux2iq.cloudfront.net/cfx/st',
'provider': 'rtmp',
'duration': '888.06',
'description': 'And the second one.'
},
{
'file': 'sunset5555.mp4',
'title': 'Third One',
'streamer': 'rtmp://s1rk84swrux2iq.cloudfront.net/cfx/st',
'provider': 'rtmp',
'duration': '653.79',
'description': 'And here is the third one.And here is the third one.'
}
]
});
</script>
Posted: Friday Jul 27th, 2012 at 6:00 pm #20449

Thank you I’m glad they have been of use.

Right basically when you generate the file you need to generate the policy, key and signature to append to the url so that access is granted, like:

"file":"videos.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoidmlkZW9zLzAwNjIvMDA2Mi0xMjgweDcyMC5tcDQiLCJDb25kaXRpb24iOnsiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJcCI6Ijg2LjE0LjE1My42NC8zMiJ9LCJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTM0MzUwOTUMn19fV19&Signature=lOfQFai6SYjREARnNPCXCpOSEGFPcdjTifaZ1V7r4cvofdrTRhJyVOD-X7SRr0pVA~~xlFVSQWTAekmS2DOi77UwNQUwWVQi4yPkugJ2JrOoc-aQrU2taB9Ik~krIzC~qwZg1agDNVZ3lqo2oQps7Y79sAr14ge0DswBhx4AVs_&Key-Pair-Id=APKAJTVWA2VC2XWZMSA"

This code may work for your setup, Its not on mine.

<?php
// Configuration.
$s2_jw_config["jwplayer"] = "/jwplayer/";
$s2_jw_config["mp4_video_file_name_1"] = "menandgrief2.mp4"; // Name of your 1st MP4 file.
$s2_jw_config["mp4_video_file_name_2"] = "menandgrief3.mp4"; // Name of your 2nd file.
?>

<div id="jwplayer">JW Player® appears here.</div>
<script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>

<?php /* A direct URL to the RTMP source; counting the file against the current User in real-time. */
$mp4_1_cfg = array ("file_download" => $s2_jw_config["mp4_video_file_name_1"], "url_to_storage_source" => true, "count_against_user" => true);
$mp4_2_cfg = array ("file_download" => $s2_jw_config["mp4_video_file_name_2"], "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_1 = s2member_file_download_url ($mp4_1_cfg, "get-streamer-array")) 
                        && ($mp4_2 = s2member_file_download_url ($mp4_2_cfg, "get-streamer-array"))) { ?>

<script type="text/javascript">
jwplayer('jwplayer').setup({
'flashplayer': '/jwplayer/player.swf',
'id': 'playerID',
'width': '650',
'height': '240',
'playlist.thumbs': 'false',
'playlist.position': 'right',
'playlist.size': '250',
'playlist': [
{
'file': '<?php echo $mp4_1["file"]; ?>',
'title': 'First One',
'provider': 'rtmp',
'streamer': '<?php echo $mp4_1["streamer"]; ?>',
'image': '/wp-content/uploads/thumbnailwindowslivewriter.jpg',
'description': 'Yep, this is the first one.'
},
{
'file': '<?php echo $mp4_2["file"]; ?>',
'title': 'Second One',
'streamer': '<?php echo $mp4_2["streamer"]; ?>',
'provider': 'rtmp',
'description': 'And the second one.'
}
]
});
</script>
<?php } else /* Access is denied to the current User. */ { ?>
    Sorry, you do NOT have access to this file.
<?php } ?>

Try that and please let me know if it works, You can see the pattern to add more files to it.

Posted: Friday Jul 27th, 2012 at 7:13 pm #20455
Echomango
Username: echomango

Philly – The playlist didn’t play. It comes up saying “JW Player® appears here.” Bless your heart for taking the time to do this. I owe you one, or maybe two. ;>) If we can get this working I will easily be able to use it as a template and fill in and change as I go. I do hope we can get it working.

I have created a temporary user named Philly with password “test” without the quotes. If that might help you to have a look. The file is titled “test-philly.”

Posted: Friday Jul 27th, 2012 at 7:29 pm #20457

Works for me using that account you created :)

Increase the downloads allowed under s2Member® File Download Options => Basic Download Restrictions
then see if it works for your account.

Posted: Friday Jul 27th, 2012 at 7:47 pm #20460
Echomango
Username: echomango

Looking back maybe I made a mistake. Should the “file”:”videos.mp4? text that you placed before the code be included in the file? It seems to include key pairs and other data. Am I supposed to edit that text based on my security data? Then include it with the other code? I’m confused. I’m also not a coder and am easily confused by this stuff. My apologies.

Posted: Friday Jul 27th, 2012 at 7:52 pm #20461
Echomango
Username: echomango

Works for you! LOL! That’s both encouraging and hilarious! I increased the downloads and tried again and it still shows the “JW Player® appears here.”

Plefase ignore the above post. I hadn’t seen your previous message.

Posted: Friday Jul 27th, 2012 at 7:55 pm #20462

No you have done it correctly.

Log out, then log in with that account you created for me and go to the /test-philly/ page and see if it works?
Works when I log in.

If your logged out or don’t have access to the file, it comes up “JW Player® appears here.” thats because the player won’t render without a valid file. I can’t see that it matters though as I suppose you wouldn’t have access to the page if you didn’t have access to the file

Posted: Friday Jul 27th, 2012 at 8:10 pm #20463
Echomango
Username: echomango

Hi Philly – Well, I have tried it by logging into your username, have tried on another browser, have tried with my ipad and each time I get the same message that ““JW Player® appears here.” Why would it work on your system and not on mine? Weird!

Posted: Friday Jul 27th, 2012 at 9:11 pm #20465
Echomango
Username: echomango

Aha! I had been using Google Chrome and decided to try Firefox. When I loaded the page in Firefox it comes up just fine! Success! Now all I need to do is figure out why Chrome is failing and I will be good to go. I also went and tried Safari and it also failed. Must be something about Safari and Chrome that are stopping up the works. Philly were you using Firefox?

Once I get safari and chrome figured out I want to post this code on the forum as an example of a way to connect JW to a playlist while using S3 and cloudfront. That way in the future folks like me will have it easier.

I can’t thank you enough Philly.

Anyone have any ideas about what might be happening here?

Thanks for any help.

Echo

Posted: Friday Jul 27th, 2012 at 10:12 pm #20469

not sure why its happening its working for me on chrome

Posted: Friday Jul 27th, 2012 at 10:57 pm #20475
Echomango
Username: echomango

Now that is really interesting that your chrome is reading it and mine is not. I guess I will check again tomorrow after I reboot and see what is up. I hope it is something wrong with my system and that all browsers are working fine. That would make it easy.

Posted: Friday Jul 27th, 2012 at 11:04 pm #20476

Sorry its not working for me in safari.

Will look at the code again tomorrow.

Posted: Saturday Jul 28th, 2012 at 6:40 am #20510

Can you download and install this plugin https://dl.dropbox.com/u/40574414/s2member-video-playlist-shortcode.zip

then in your post/page use

[s2video]

See if that works, then we can clean it up if it does

Posted: Saturday Jul 28th, 2012 at 8:51 am #20524
Echomango
Username: echomango

Good morning Philly. Bless your perseverance. I activated the plugin and created a page “test-plugin.” It sadly gives the same response in firefox, chrome, and safari “JW Player® appears here.” It will be interesting to see if your version of these browsers gets the same result.

I hope I activated the plugin properly. Up to this point I have always used the wordpress panel to load and activate plugins. This time I ftp’d the plugin PHP file you sent to me to the wp-content/plugins directory and then went to the wordpress plugin admin section where wordpress recognized the plugin and I clicked “activate.” I am assuming that means success.

It was great to see how the plugins work. I had always wondered and doing this has given me the opportunity to see exactly how they work. Very cool and elegant process isn’t it?

Posted: Saturday Jul 28th, 2012 at 9:14 am #20528

It certainly is defiantly good to look more into how they work.

Right I’m confident this will work across all browsers its a different approach as webkit based browser don’t seem to like the other method.

https://dl.dropbox.com/u/40574414/s2playlist.zip

Use it in posts/pages like:

[s2playlist video1="menandgrief2.mp4" title1="Title One" desc1="Description One" image1="/wp-content/uploads/thumbnailwindowslivewriter.jpg" video2="menandgrief3.mp4" title2="Title Two" desc2="Description Two" image2="/wp-content/uploads/thumbnailwindowslivewriter.jpg"  ]
Posted: Saturday Jul 28th, 2012 at 10:17 am #20535
Echomango
Username: echomango

Excellent! It works in all three! Wonderful. I can’t thank you enough Philly. I added a picture and it comes out great into the main video. Is it a simple task to create thumbnails for the playlist on the right?

I really think that you should post this so that others coming here can copy that code and have it up and running in short order. No reason for them to have to repeat your great efforts!

Thanks so much Philly. BTW, are you an Eagles fan?

Echo

Posted: Saturday Jul 28th, 2012 at 3:16 pm #20558

Hi Echo,

Here is the finished plugin. (deactivate the other one first)

Has fallback options and displays thumbs etc.

https://dl.dropbox.com/u/40574414/s2member-playlist-shortcode.zip

Use it like this:

[s2playlist size="3" width="630" height="335" playlistsize="250" playlistthumbs="true" playlistposition="right" video1="video1.mp4" image1="full-path-to-image.jpg" title1="Title One" desc1="Description One" video2="videos2.mp4" image2="full-path-to-image.jpg" title2="Title Two" desc2="Description Two" video3="videos3.mp4" image3="full-path-to-image.jpg" title3="Title Three" desc3="Description Three"]

size = number of videos in the playlist, then just reference them in the shortcode and the plugin will do the rest

Posted: Saturday Jul 28th, 2012 at 5:33 pm #20560
Echomango
Username: echomango

Beautiful! Works like a charm. Thanks so much Philly.

I have to laugh at myself. I had been working to expand your earlier plugin to do three and four videos and was getting nowhere, LOL. I’m sure for you it was a walk in the park but for me, not so much. ;>) My eyes lit up when I saw your post since I could stop my frustration. lol

One other question. When I expand the size of the playlist it tends to begin at the expected left margin but as it increases in size it spills over onto the background area on the right side. If it could be centered it would just about fit into the normal “text space.” Is there a simple way to center it? I tried

<center>

tags around the shortcode but nothing. It will be easy to simply downsize the player and have it fit just fine but if there was a simple way to center it I could have it be a bit larger. Anything easy to do that?

Thanks again.

Echo

  • This reply was modified 4 years, 5 months ago by  Echomango.
Posted: Sunday Jul 29th, 2012 at 12:51 pm #20617
Core Love
Username: corelove

The plugin is great, I have spent days trying to get my jw player working. Now my videos play great!

Is there a way to increase the amount of videos to more than 3 in the playlist?

Is there a place we can add something to the php for custom skins or HD option?

Thank you so much for making this.

Core

Posted: Sunday Jul 29th, 2012 at 2:33 pm #20621

@ Echo

Its mainly down to your theme so you will need to play with the css.

maybe adding something like

#videoplayer{margin: 0 auto;}

to your themes style.css file. #videoplayer being the id of the player.

And as you know you can play around with the shortcode attributes

width="630" height="335" playlistsize="250"

Maybe make playlistsize smaller.

Hope that helps you, let me know.

@ Core

Thank you, I’m glad its working for you.

Yes I will look into expanding it for those features.

And yes you can increase the amount of videos in the playlist:

size="3"

Change that to the amount of videos in your playlist, then you must reference them in the shortcode like:

video1="video1.mp4" video2="videos2.mp4" video3="videos3.mp4" video4="videos4.mp4" video5="videos5.mp4"

so if you had 10 videos the reference for the last video would be

size="10" .................... video10="video10.mp4"

Let me know how you get along

Posted: Sunday Jul 29th, 2012 at 2:45 pm #20623
Core Love
Username: corelove

Thanks Philly, I didn’t realize that I could add coding to the theme for the player.

I will try adding more videos to the player today.

The coding for the plugin looks like it has other options to choose from if the bandwidth is too slow or it also depends on the type of video file.

Is it possible to take out the one for downloading the videos?
I have 2 versions of every video that I shoot so I can supply a SD/HD video option. On my old membership site, members just had to click one button and it would change one of their shortcodes linked with their membership, that would update the whole site. Since that isn’t really possible s2member, I am looking for another way.

I appreciate the quick response. I just finished setting up S2member, woocommerce, wpmu and buddypress on my main domain. I have IdevAffiliate integrated as well. I am wondering if you know someone that I could pay to review and test my site to make sure I set everything up proper. We are going to start transferring members from my other site to this new one in the next few days.

Thanks again.

Core

Posted: Sunday Jul 29th, 2012 at 3:07 pm #20624

Hi Core,

I have made a shortcode that I’m currently using that can switch videos between SD and HD, but I don’t use a playlist.

The plugin has fallbacks for people that don’t have flash (iPhones/iPads). The download fallback can also be removed, but please bear in mind to make sure people can’t download the video full stop you can only stream in rtmp mode, so no fallbacks.

So what features do you need? sd/hd, playlist, skin and no download?

I’m not sure about someone to test and review but I would be happy to take a quick look and let you know if I can see any problems but I’m not an expert in those setups.

If you want to private message me you can email: me {at} phillymax dot com

Posted: Sunday Jul 29th, 2012 at 6:15 pm #20631
Posted: Monday Jul 30th, 2012 at 7:14 am #20668
Echomango
Username: echomango

Thanks Philly, I will play with the CSS and see what happens.

You are really an asset here and I truly appreciate your help with this. In some ways it reminds me of the old days on the internet in the early 90’s with many people lending each other a hand. I hope there is something I can do for you.

I would love to see any new versions you come up with that add more features. That would just be more whipped cream on top of an iced cake with ice cream. ;>)

Echo

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