Play FLV/MP4 Attachments!
First of all, you will need to create a new BB Code:
Login to your Administration Panel, find "Custom BB Codes" in the sidebar, click it. And click add new BB Code: Title: attachvideo BB Code Tag Name: attachvideo Replacement: HTML Code:
<script type="text/javascript" src="http://yoursite.com/flashplayer/jwplayer.js"></script> <div id='mediaspace_{param}'>Loading the player...</div> <script type='text/javascript'> jwplayer('mediaspace_$attachment[attachmentid]').setup({ 'flashplayer': 'http://yoursite.com/flashplayer/player.swf', 'file': 'http://yoursite.com/attachment.php?attachmentid={param}', 'controlbar': 'bottom', 'width': '720', 'height': '480', 'type': 'video', 'provider': 'video' }); </script> It will give you this message: "The following BB Code replacement may not be properly formed. All HTML attributes should be enclosed within double quotes. " Click "Continue", since the BB Code will work without any problems... Example: [attachvideo]2322[/attachvideo] Description: With this BB Code you will be able to embed multiple videos that are uploaded as attachments. Use {option}: No. Remove Tag If Empty: Yes. Disable BB Code Within This BB Code: Yes. Disable Smilies Within This BB Code: Yes. Save it... Now, how to take out the attachment ID from the link? Let's say that you uploaded some .flv file, when you hover over it, you'll see something similar to this: http://yourdomain.com/attachment.php?attachmentid=2322&stc=1&d=1302358811 Part that you need is "2322" Simply wrap it in: [attachvideo]2322[/attachvideo] You need JW Player for this, download it here: http://www.longtailvideo.com/players/jw-flv-player/ Create a new folder in your public_html called "flashplayer", upload these files in it: - jwplayer.js - player.swf - swfobject.js - yt.swf http://i.imgur.com/td0qU.png Enjoy! Download
player.zip (284.4 KB, 280 downloads) |
Similar Mods
BB Code Enhancements JW + Flowplayer For FLV - MP4 Video Player | vBulletin 4.x Add-ons |