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.

JWPlayer (Licensed) with S2member

Home Forums Community Forum JWPlayer (Licensed) with S2member

This topic contains 9 replies, has 4 voices. Last updated by  Vashte Johnson 4 years, 9 months ago.

Topic Author Topic
Posted: Tuesday Mar 20th, 2012 at 5:41 pm #8651

Hi guys,

I’m embedding videos on my site using the JWPlayer plugin for WordPress…or I was anyway. Now that my files are streaming from Amazon S3 (using Cloudfront), I’m using the code supplied under S2member->Download Options-> JW Player & RTMP Protocol Examples->JW Player® ( RTMP streaming MP4, via s2Member’s Amazon® S3/CloudFront integration ).

Using this code appears to bypass any settings in the JWPlayer WordPress plugin, since I’m not calling it with a short code.

So, using the code supplied above, what’s the best way to customize the JWplayer embed? How can I add plugins I bought from LongTail? How can I add skins? etc etc…

Thanks!

V

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Wednesday Mar 21st, 2012 at 2:01 am #8689

I don’t really know how to answer that, so I’ll forward your question to Jason. Thanks for your patience. :)

Posted: Wednesday Mar 21st, 2012 at 6:18 am #8713

Hi Vashte,

I have just finished a complex embed like the one you need. What were your setting, plugins and skins if you let me know what you want to achieve I can talk you through it :)

P

Posted: Wednesday Mar 21st, 2012 at 3:23 pm #8787

Hi @Philly! Thanks for offering to help.

Im using JWPlayer 5.9 (licensed) with the Stormtrooper skin.

Plugins I’d like to use are HD, Lights Out, and Screenshot.

I’m just not sure, using the S2member embed, how to call these plugins.

Thanks!

Posted: Wednesday Mar 21st, 2012 at 4:16 pm #8789

Hi Vashte,

I think this will work, remember you will need the php and raw html plugins to use this code in page/post.

I’m assuming your player is located yoursite.com/jwplayer/jwplayer.js and your skin yoursite.com/jwplayer/skins/stormtropper.zip

<div id="player"></div>
<script type="text/javascript" src="<?php echo get_bloginfo( 'siteurl' ); ?>/jwplayer/jwplayer.js"></script>

<?php /* A direct URL to the RTMP source; counting the file against the current User in real-time. */
$mp4_cfg = array ("file_download" => "SDvideo-location-here.mp4", "url_to_storage_source" => true, "count_against_user" => true); 
$mp4hd_cfg = array ("file_download" => "HDvideo-location-here-.mp4", "url_to_storage_source" => true /* Don't count variations. */); ?>

<?php if (($mp4 = s2member_file_download_url ($mp4_cfg, "get-streamer-array")) 
     	&& ($mp4hd = s2member_file_download_url ($mp4hd_cfg, "get-streamer-array"))) { ?>
<script type="text/javascript">
var options = {
    file: "<?php echo $mp4["url"]; ?>",
	image: "<?php echo get_bloginfo( 'siteurl' )  ; ?>/poster.jpg",
	height: 270,
    width: 480,
    skin: "<?php echo get_bloginfo( 'siteurl' ); ?>/jwplayer/skins/stormtropper.zip",
	modes: [
        { type: "flash", 
		  provider: "rtmp", 
		  src: "<?php echo get_bloginfo( 'siteurl' ); ?>/jwplayer/player.swf",
          config: {streamer: "<?php echo $mp4["streamer"]; ?>", file: "<?php echo $mp4["file"]; ?>"}
		},
		/* switch to html5 player if no flash support */
        { type: 'html5' },
		/* Download the file. */
        {type: "download", 
         config: {file: "<?php echo $mp4["url"]; ?>"}}
    ],
	/* Start plugins. */
    plugins: {	
                'hd-2': {file: '<?php echo $mp4hd["url"]; ?>'},
	 	'lightsout-1': {}
    },
    
};
jwplayer("player").setup(options);
</script>
<?php } else /* Access is denied to the current User. */ { ?>
    Sorry, this video does not exist yet or you do NOT have access to this file.
<?php } ?>

As for screenshot I dont think its supported in v5 and above.

Do you need more options like fallbacks?

P

  • This reply was modified 4 years, 9 months ago by  Philly. Reason: oops forgot script closing tag
Posted: Wednesday Mar 21st, 2012 at 9:35 pm #8796

Sorry I have just noticed only works in the html5 video mode and you get a stream not found message when switching to hd in flash mode, needs some more work

Posted: Wednesday Mar 21st, 2012 at 10:35 pm #8804

Hey Philly,

It actually works really well – thanks! I just need to point to some SD versions of my files, and I think it’ll be good to go. This is what I ended up using:

[s2If current_user_can(access_s2member_level0)]
<div align="center">
<div id="jw-container">JWPlayer goes 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. */
$mp4_cfg = array ("file_download" => "B1_knitPad_kfb.mp4", "url_to_storage_source" => true, "count_against_user" => true); 
$mp4hd_cfg = array ("file_download" => "AB3_knitPad_LTCO.mp4", "url_to_storage_source" => true /* Don't count variations. */); ?>

<?php if (($mp4 = s2member_file_download_url ($mp4_cfg, "get-streamer-array")) 
     	&& ($mp4hd = s2member_file_download_url ($mp4hd_cfg, "get-streamer-array"))) { ?>
<script type="text/javascript">

var options = {
    file: "<?php echo $mp4["url"]; ?>",
	image: "<?php echo get_bloginfo( 'siteurl' )  ; ?>/poster.jpg",
	height: 270,
    width: 480,
    skin: "<?php echo get_bloginfo( 'siteurl' ); ?>/jwplayer/skins/stormtrooper/stormtrooper.zip",
	modes: [
        { type: "flash", 
		  provider: "rtmp", 
		  src: "/jwplayer/player.swf",
          config: {streamer: "<?php echo $mp4["streamer"]; ?>", file: "<?php echo $mp4["file"]; ?>"}
		},
		/* switch to html5 player if no flash support */
        { type: 'html5' },
		/* Download the file. */
        {type: "download", 
         config: {file: "<?php echo $mp4["url"]; ?>"}}
    ],
	/* Start plugins. */
    plugins: {	
               'hd-2': {file: '<?php echo $mp4hd["url"]; ?>'},
	       'lightsout-1':{'dock':'true', 'oncomplete':'on'},
               'timeslidertooltipplugin-2':{},
               'tweetit-1':{},
               'fbit-1':{}
    },
    
};
jwplayer("jw-container").setup(options);
</script>
<?php } else /* Access is denied to the current User. */ { ?>
    Sorry, this video does not exist yet or you do NOT have access to this file.
<?php } ?>
</div>
[/s2If]

The lightsout plugin still isn’t 100% functional, but that’s a whole other issue. I’ve reached out to LongTail for more info on that. Thanks so much for your help with this!!

Posted: Thursday Mar 22nd, 2012 at 12:33 pm #8844
Raam Dev
Username: Raam
Staff Member
Awarded Vashte the Experienced badge.
Posted: Thursday Mar 22nd, 2012 at 1:07 pm #8849

Hi Vashte,

The mistake I was making was this

'hd-2': {file: '<?php echo $mp4hd["url"]; ?>'},

should be

'hd-2': {file: '<?php echo $mp4hd["file"]; ?>'},

so you keep rtmp when switching file.

also to get the settings working pass them outside of the plugin like

/* Start plugins. */
    plugins: {	
               'hd-2': {file: '<?php echo $mp4hd["file"]; ?>'},
	       'lightsout-1':{},
               'timeslidertooltipplugin-2':{},
               'tweetit-1':{},
               'fbit-1':{}
    },
    'dock':'true', 
    'oncomplete':'on'

Hope that helps :)

Posted: Thursday Mar 22nd, 2012 at 6:00 pm #8866

@Raam – Sweet!! Thanks!

Philly – you’re completely right. I was getting “Stream Not Found” errors until I changed “url” to “file”.

Also, re: lights out, I got a fix from Longtail. Apparently there’s a conflict between the lightsout and time slider plugins, so I had to host the lightsout js file on my server instead of calling it from longtail’s. :/

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