Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
Play FLV/MP4 Attachments Details »»
Play FLV/MP4 Attachments
Version: 1.1, by Frosty Frosty is offline
Developer Last Online: Dec 2011 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.8.x Rating:
Released: 04-08-2011 Last Update: Never Installs: 3
Re-useable Code  
No support by the author.

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=130235881 1

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!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-10-2011, 06:19 AM
yahooooh yahooooh is offline
 
Join Date: Nov 2009
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

could you plz make it support mp3
and also update it for vb4
Reply With Quote
  #3  
Old 04-10-2011, 07:04 AM
Frosty Frosty is offline
 
Join Date: Apr 2011
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@yahooooh
If you don't have the mp3 extension in Attachment Manager add it, pick the biggest size that should be allowed for mp3 files, and MIME Type you need to enter is "audio/mpeg".

Now, go to the creation of new BB Codes..

Title: mp3
BB Code Tag Name: mp3
Replacement:
HTML Code:
<script type='text/javascript' src='http://yoursite.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': '24',
'type': 'sound'
});
</script>
Example: [mp3]2948[/mp3]
Description: Use this BB Code to play MP3 files that are uploaded as attachments.
Use {option} : No
Button Image: Optional
Remove Tag If Empty: Yes
Disable BB Code Within This BB Code: Yes
Disable Smilies Within This BB Code: Yes

Save...

About this BB Code for vBulletin 4, I'll install vb4 on localhost later, so I'll see what I can do, shouldn't be much different than this one.
Reply With Quote
  #4  
Old 05-14-2011, 06:08 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FallenBeauties View Post
@
About this BB Code for vBulletin 4, I'll install vb4 on localhost later, so I'll see what I can do, shouldn't be much different than this one.
Okay please do I really need this.
Reply With Quote
  #5  
Old 05-20-2011, 09:59 PM
Frosty Frosty is offline
 
Join Date: Apr 2011
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Octavius!
https://vborg.vbsupport.ru/showthread.php?t=263950

There you go.
Reply With Quote
  #6  
Old 05-21-2011, 01:00 AM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your awesome dude!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:54 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04785 seconds
  • Memory Usage 2,261KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete