Back to vBulletin 3.8 Template Modifications

Play FLV/MP4 Attachments
Mod Version: 1.1, by Frosty

vB Version: 3.8.x Rating: (1 vote - 5.00 average) Installs: 3
Released: 09 Apr 2011 Last Update: Never Downloads: 0
Not Supported Re-usable Code External Content  

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://yourdomain.com/flashplayer/jwplayer.js'></script> 
<div id='mediaspace_$attachment[attachmentid]'>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=$attachment[attachmentid]',
'controlbar': 'bottom',
'width': '720',
'height': '480',
'type': 'video',
'provider': 'video'
});
</script>
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]

Obviously, you'll need JWPlayer for this, you can download JWPlayer from here:
http://www.longtailvideo.com/players/jw-flv-player/

After you've downloaded it, unzip it , and upload it on your server, make sure you enter the correct path of the .js and .swf file for the BBCode replacement.

If you want to make it easy, just create a directory called "flashplayer" in your root forum directory, and upload all JWPlayer files in it, replacement I've pasted in this will work with that path, otherwise, you'll have to set your own path.

p.s. If you can't upload .flv or .mp4 files as attachments, that means you don't have that extension set in the Attachments Manager.

Create them, and everything will work!

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024