Источник
http://www.vbulletin.org/forum/showthread.php?t=238021
From the guy who brought you cheap knock-offs of other people's stuff, comes even more knock-offs of other people's stuff.
AME Definitions for the JW Player
========================================
IMPORTANT - PLEASE READ
This is an add-on for The Geek's AME - The Automatic Media Embedding System. Which means if you don't know what an AME CP is, you can't install these definitions.
========================================
What This Is
If you have The Geek's AME - The Automatic Media Embedding System installed, then you likely already have some or all of my massive collection of media definitions: DJ's AME (Auto Media Embedding) XML Media Definitions (Delta Edition). This is one more definition for that collection. However, it's special. So special it needs it's own thread. Read below to find out why.
The JW Player
The JW Player is a customizable player distributed for free by Long Tail Video. It's Open Source and has a number of skins and plugins to make it fit perfectly with the look and feel of your site. The latest version of the player let's you customize a skin using just images and an XML file, without really needing to know anything about coding or flash. That and the many other features available in the player makes this invaluable to many webmasters.
AME Integration
While the JW Player cannot be implemented to work with the entire set of AME definitions, it can, however, be made to work with YouTube and WMV files. I'm releasing this definition for YouTube first, and later on I'll add a definition for Silverlight (WMV).
Screenshots
Live Demo
Don't let the demo fool you. You can only use one skin per definition. But changing the skin in the definition will only change the skin in new posts, not old ones (as you can see here.) Old posts will need to be resaved. I'm currently using the Schoon skin. (Periodically, I have to turn the demo off so I can work on the regular YouTube definition.)
Installation
If you already have the JW Player installed on your website, then all you really need to do is skip to the Step 3 and configure the URLs to point to the right locations.
Download the JW Player from Long Tail Video.com. Unzip the contents and upload the .SWF, .JS, .FLV and .YT files to a folder in your forum root named videos. (Obviously, if you don't have that directory, create it.)
Download a skin for the player from their Skin Library. (You can create your own later. Just pick something nice for right now.) Unzip the contents and add the .SWF file to your videos directory.
Delete your existing YouTube definition. (Just YouTube, folks. Don't go crazy deleting everything that has the word YouTube in it.)
Download the Attachment 113875 file and import it into your AME CP.
Either during import or after, configure the URLs in your new YouTube definition to point to the correct locations. Three URLs highlighted in red here, currently point to my website, so change those. Also change the name of the skin file, in blue here, if your not using Schoon.
Code:
<script type='text/javascript' src='http://www.cogonline.net/forums/videos/swfobject.js'></script>
<script type='text/javascript'>
var s1 = new SWFObject('http://www.cogonline.net/forums/videos/player.swf','player$p1','$ameinfo[width]','$ameinfo[height]','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=$ameinfo[url]&skin=http://www.cogonline.net/forums/videos/schoon.swf&image=http://img.youtube.com/vi/$p1/0.jpg');
s1.write('preview$p1');
</script>
For more information on the wealth of things you can do with the JW Player, please visit their website and read up on all the goodies.
Known Issues
The JW Player posts via JavaScript, and as you you know, JavaScript doesn't display inside AJAX functions. This means you won't see the video if you post via Quick Reply or if you've edited the post inline. However, your the only one who will see it that way. It will display normal for everyone else, and will display again the next time you reload/refresh the page. I've setup a notification for this when it's posted alongside the message that notifies a user who needs to upgrade their Flash Player.
Also, vBadvanced. I can't reiterate this enough times. Set your character count high enough, or stop trying to get videos to show in the modules. Otherwise, there won't be enough room to display all the code of the video, and the code will get truncated.
One other thing. Whenever you upgrade AME or re-install it, you get your default definitions back. So please, check your definitions before you start posting that you're getting two YouTube videos in a post. This was covered in the last two threads' FAQ section.