Autoembed and FlowPlayer Plugin for Wordpress and MyBB!
This plug-in is basically a object oriented building block that connect two open source products, Autoembed PHP Class and FlowPlayer to a plug-in system for Wordpress and MyBB and is initialised by one piece of BBCode [vid][/vid] which is not much for one user to remember. In MyBB “BBCode” is referred to as “MyCode.”
Autoembed PHP Class is an open source product from autoembed.com; the PHP class automatically embed videos from video sharing site such as YouTube and Metacafe and currently supports around 150 video sharing sites.
FlowPlayer is an open source Flash Video Player from flowplayer.org and allows the client to use self-hosted video files that is supported by Adobe Flash such as flv, mp4(h.264) and m4v except swf for security reasons.
The Plug-in also has support for iPhone and iPod Touch with MP4, MOV and MP3 extentions via QuickTime and YouTube Videos, however there is no guarantee of video playback, one because of the technical limitation of the devices and two the video uploader on YouTube can choose to disable video playback on mobile devices.
This site currently provide two different version of the plug-in Wordpress and MyBB, there are no plan on making this plug-in available for other PHP based software but because this plug-in is released under the New BSD License, you’re more than welcome to make a different version of this plug-in (see License and Disclaimer for conditions and restrictions).
This plug-in require PHP 5.2.3 or above and may not run on Windows systems, as this plug-in is written for Unix based or Unix like systems.
Got feedback and suggestions, why not leave a comment? Anyway the vid tag idea came from Tim Eckel of Arcade@Home.
Demo
Code
[vid=640x480]http://file.therockerscabin.com/video/pet/SqueakTheCat.mp4[/vid]
Output
To add preview image to video, make sure you save the image as jpg in the same name as the video file including the extension plus .jpg after the extension (e.g. SqueakTheCat.mp4.jpg) and in the same directory as the video conterpart
Code
[vid]http://www.youtube.com/watch?v=dSLuju8Tfjk[/vid]
Output
Code
[vid]http://file.therockerscabin.com/audio/Giggity_Giggity_Giggity.mp3[/vid]
Output
Download
for Wordpress
for MyBB
Changelog
1.6.9a
- Renamed “XMLMode” to “FeedMode”.
- Removed support for “f4v” as FlowPlayer doesn’t support that extension.
- [MyBB] Fix: Return error while AJAX (or xmlhttp.php) is used within Quick Edit and Quick Reply.
- [MyBB] Return static html while AJAX (or xmlhttp.php) is being used rather then JavaScript.
Note: xmlhttp.php does not seem to include global.php which include a plugin hook called “global_start” where the class is initialised.
1.6.9
- Added XMLMode for RSS, ATOM and RDF feeds, returns link rather then embedded code while XMLMode is active.
- Extended iPhone/iPod Touch support to YouTube video, iPhone/iPod Touch support is now completed.
- Updated AutoEmbed PHP Class to revision 214.
- Change plugin uri to autoembed.com/download.
1.6.81
- A few minor improvement.
- Minimize the risk of SWFObject failing by making div id unique to a page.
1.6.8
- Using a slightly modified Autoembed PHP Class 1.5 and added support for SWFObject, which has very good browser and flash detection.
- [WordPress] Fixed critical problem that causes errors with feeds that WordPress produces.
1.6.7
- Updated Autoembed PHP Class to 1.5, embed MP3 via Google Audio Player and produces valid XHTML.
1.6.6
- Added possible bug fix for WSOD appearing on some installations.
1.6.5
- Added ability to change FlowPlayer setting by creating a new javascript file, just create a copy of flowplayer-call.js and call it flowplayer-call-override.js in the plugin directory.
- Now only construct object once per page rather then per post, making the script more efficient.
- [MyBB] Added ability to specify minimum and maximum height and width via admin panel.
1.6.0
- Added ability to detect iPhone and iPod Touch if detected it will use QuickTime player that built into the devices for mp4, m4v and mov containers. See iPhone Tech Specs regarding Video Playback for compatibilty details.
- Removed JW Player because it is not free for commercial use (Creative Commons Non-Commerical) and is not truely open source as longtail video claim to be.
- FlowPlayer replace JW Player because it is free for commercial use (GNU GPL v3) and is open source.
- Removed previous version off this site because it contains JW Player.
1.5.0
- Added [vid=300x300] to avoid confusion with MyBB [img=300x300], [vid 300x300] still works.
- [Wordpress] Replace tag with blank in post excerpt.
- [MyBB] Simplify video button to one dialogue box.
- Refactored the code to make sure each method complaint to the Single Responsibility Principle.
- Made it more easier to port to other PHP based software.
1.4.1
- Escape empty [vid] tags to prevent bug with certain version of PHP from being triggered.
1.4.0
- Released wordpress version.
- Made the code easier to port to other PHP based system.
- Fixed parsing bug with RSS feed with the Flash version JW Player, Silverlight version still doesn’t work with RSS feeds.
- Now include the Autoembed PHP Class, striped out Autoembed API for the sake of performance.
- Change minimum resolution to 120×120.
- Renamed to Autoembed and JW Player Plugin.
1.3.0
- Last.fm audio embed stays as transparent rather then window.
- Improved performance by moving some function into the class and turning them into methods.
- Added support for WMA, WMV and VC-1 thanks to Longtail JW Player (once again) and Microsoft Silverlight.
- Longtail (http://www.longtailvideo.com/) JWPlayer (Adobe Flash and Microsoft Silverlight) is now included with package under Creative Commons. (Non-commercial Sharealike) (http://creativecommons.org/licenses/by-nc-sa/2.0/).
1.2.0
- Added custom resolution support for AutoEmbed API, custom resolution support is now complete.
- Added toolbar button using toolbar-container(http://www.rioastamal.net/mybb/toolbar-container/).
- Added preview image support for JW Player providing “example.mp4.jpg” is in the same location as “example.mp4″, only support jpg extentions and limited to 75KB to prevent server from overloading.
- Added maximun resolution of 860×600.
- Change WMODE param from “transparent” to “window” on AutoEmbed API and PHP Class to prevent interfearent with CSS3 propertise such as opacity.
- Change minimum resolution from 300×300 to 240×240.
1.1.1
- Added custom resolution support for AutoEmbed PHP Class.
- Added minimum resolution of 300×300, so no users can do anything quite silly.
- Change plugin website to “www.autoembed.com” just to show respect.
1.1.0
- Added Support for AutoEmbed PHP Class.
- Added Error Handler, error only show in preview post
- Plugin Name finalised to “Autoembed MyCode Plugin for MyBB.”
- Refactored the code, minimised coupling and improved cohesion.
1.0.1
- Check for valid url
1.0
- First Public Version Released
License and Disclaimer
New BSD License
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of cj-jackson.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This license and disclaimer does not apply to FlowPlayer and Autoembed.com PHP Class.
- Autoembed.com PHP Class is copyrighted to Autoembed.com and is under GNU Lesser General Public License.
- FlowPlayer is copyrighted to FlowPlayer.org and is under GNU General Public License with Additional Term.
- SWFobject originally came from http://code.google.com/p/swfobject/ and is under the MIT License.


{ 2 comments… read them below or add one }
Thank you for the
Feedback:
1) The files 1.6.7 are switched in your Download list, in which Wordpress 1.6.7 is under myBB and myBB 1.6.7 is under Wordpress.
2) Youtube video does not show on my myBB forum, nor is shown on your web page. [vid]http://www.youtube.com/watch?v=dSLuju8Tfjk[/vid]
Also not working on your web page
[vid]http://file.therockerscabin.com/audio/Giggity_Giggity_Giggity.mp3[/vid]
Only this one works:
[vid=640x480]http://file.therockerscabin.com/video/pet/SqueakTheCat.mp4[/vid]
I tested a flv file on my website and it works well. But, not youtube on both your and my pages. Any ideas? Thanks much for the wonderful plugin.
Ohh, cute cat!
1) I just put that right.
2) What browser are you using? I tested this with Chrome and it work, but it failed with Firefox just a white blank box, I think it got something to do with the valid XHTML that Autoembed PHP Class 1.5 produces, the temporary solution would be to use “AutoEmbed.class.php” from 1.6.6 (or http://autoembed.googlecode.com/files/AutoEmbed-1.4.tar.gz ) replacing the one that you got uploaded on your server, leave stubs.php as it is. I already notified the developers of Autoembed of that problem.
Thanks for the compliment.