Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Embedded media player in post Details »»
Embedded media player in post
Version: 1.00, by ericgtr ericgtr is offline
Developer Last Online: Feb 2022 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 11-24-2004 Last Update: 05-14-2005 Installs: 149
 
No support by the author.

This is my first mod for VB, I personally need it on my site because it's focus is MP3's, it may be able to be customized for other uses I would think. What it does is embeds Windows Media Player into the body of the post (as well as the regular attachment) using bbcode and plays the attached MP3 file. What this does upon completing the upload is allows the user to copy and paste the URL to the attached file if they choose.

Also, since this bbcode is the Windows Media Player it may also be able to play .avi, .wmv, .mpg etc. So to broaden this you can change the [MP3] [/MP3] tag to something else like [MEDIA] [/MEDIA] for example.

There is no option to secure this to specific groups, however you can use Princeton's Allow Group to Read Titles / Not Content modification as an alternative.

Better template formatting, also maybe add a javascript function so that a user can click to add the line of code to the post.

If you find this useful please Click Install

Update: Added an option to allow only certain groups to add the option to view/paste the URL in their post.

Show Your Support

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

Comments
  #42  
Old 12-15-2004, 04:03 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't need this mod but I figured I'd contribute...

The player code [BBCODE] you have would "bloat" any web page with unneccesary code (slows download of page).

Use this instead: NOTE: This code is not for video. If you want to display video you will need to add/edit new params to the javascript.

INSERT IN vbulletin_global.js (or some javascript file that is fetched from showthread.php)
Code:
function embedwma (wma,w) {
        	var str='';
 	str='\n<object id="MediaPlayer1" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="'+w+'" height="20">\n'
        		+'<param name="fileName" value="'+wma+'">\n'
        		+'<param name="animationatStart" value="false">\n'
        		+'<param name="autoStart" value="false">\n'
        		+'<param name="showControls" value="true">\n'
        		+'<param name="Volume" value="100">\n'
 		+'<embed name="MediaPlayer1" src="'+wma+'" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="'+w+'" height="25" autostart="0" showcontrols="1" volume="100">\n'
        		+'<\/embed><\/object>\n'
 		+'<noembed>Don\'t have Windows Media Player? <a href="http://www.windowsmedia.com/MediaGuide/Home" tile="download windows media player">Download it free!<\/a><\/noembed>\n';
        	document.write(str);
        }
Title: MUSIC
Tag: MUSIC
USE THIS FOR BBCODE REPLACEMENT:
Code:
<script type="text/javascript">embedwma('{param}','{option}');</script>
Example: [MUSIC="280"]http://www.alldanzradio.com/playmusic_mp.asp?channel=swordfish[/MUSIC]
Description: Embed Music within posts. Example: [MUSIC="enter width of controls here"]enter url to file[/MUSIC]
Use {option}: YES

hope you like ...
Reply With Quote
  #43  
Old 12-15-2004, 05:05 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by princeton
I don't need this mod but I figured I'd contribute...

The player code [BBCODE] you have would "bloat" any web page with unneccesary code (slows download of page).

Use this instead: NOTE: This code is not for video. If you want to display video you will need to add/edit new params to the javascript.

INSERT IN vbulletin_global.js (or some javascript file that is fetched from showthread.php)
Code:
function embedwma (wma,w) {
        	var str='';
 	str='\n<object id="MediaPlayer1" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="'+w+'" height="20">\n'
        		+'<param name="fileName" value="'+wma+'">\n'
        		+'<param name="animationatStart" value="false">\n'
        		+'<param name="autoStart" value="false">\n'
        		+'<param name="showControls" value="true">\n'
        		+'<param name="Volume" value="100">\n'
 		+'<embed name="MediaPlayer1" src="'+wma+'" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="'+w+'" height="25" autostart="0" showcontrols="1" volume="100">\n'
        		+'<\/embed><\/object>\n'
 		+'<noembed>Don\'t have Windows Media Player? <a href="http://www.windowsmedia.com/MediaGuide/Home" tile="download windows media player">Download it free!<\/a><\/noembed>\n';
        	document.write(str);
        }
Title: MUSIC
Tag: MUSIC
USE THIS FOR BBCODE REPLACEMENT:
Code:
<script type="text/javascript">embedwma('{param}','{option}');</script>
Example: [MUSIC="280"]http://www.alldanzradio.com/playmusic_mp.asp?channel=swordfish[/MUSIC]
Description: Embed Music within posts. Example: [MUSIC="enter width of controls here"]enter url to file[/MUSIC]
Use {option}: YES

hope you like ...
Interesting princeton, so will this grab the url of the uploaded attachment and surround it with the proper quote?
Reply With Quote
  #44  
Old 12-15-2004, 05:25 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's the same as your code ... it just doesn't repeat the player code over and over again (everything is done on the client side)

FYI
you have a previous example with attachment id (.avi)
you do not need to add an extension ... the file is fetched by attachment.php (a function) with the proper extension

Also, you may have to create another function to hide BBCODE if viewer does not have permission to download attachment file; otherwise, user will get an error message.
Reply With Quote
  #45  
Old 12-15-2004, 06:05 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, thanks for this.
Reply With Quote
  #46  
Old 12-19-2004, 03:26 AM
djjeffa's Avatar
djjeffa djjeffa is offline
 
Join Date: Aug 2004
Posts: 521
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok i installed it but the manage atachment window gets kind of messy when you have mor then one plue it showes up with every atachment is ther a way to make them only show up for media and not pics?
Reply With Quote
  #47  
Old 12-20-2004, 06:03 PM
fatalsex fatalsex is offline
 
Join Date: Jul 2004
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

General question.

I'm posting file video.avi
ALL the guests can see the file . ( mean to WATCH)
How can i DENY them to watch ? Meaning only for Registered Members.
And on the place of Video file custom text like To Watch the Movie plz Register . etc
Thanks
Reply With Quote
  #48  
Old 12-20-2004, 06:13 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fatalsex
General question.

I'm posting file video.avi
ALL the guests can see the file . ( mean to WATCH)
How can i DENY them to watch ? Meaning only for Registered Members.
And on the place of Video file custom text like To Watch the Movie plz Register . etc
Thanks
Try to edit usergroup right where the attachment option is.
Reply With Quote
  #49  
Old 12-20-2004, 06:27 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by stitch
Try to edit usergroup right where the attachment option is.
I don't think that will work because we are basically bypassing all security for this to work. It's unfortunate because I am unable to come up with a way to secure custom bbcode, that's pretty much why i've halted work on this.
Reply With Quote
  #50  
Old 12-20-2004, 06:31 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ericgtr
I don't think that will work because we are basically bypassing all security for this to work. It's unfortunate because I am unable to come up with a way to secure custom bbcode, that's pretty much why i've halted work on this.
Then try the Usergroup can/cannot read content hack. This hack basically allow them to read the title only - not the content. I don't remember the exactly location but it is on this board :smoke: :smoke:
Reply With Quote
  #51  
Old 12-20-2004, 06:48 PM
fatalsex fatalsex is offline
 
Join Date: Jul 2004
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by stitch
Then try the Usergroup can/cannot read content hack. This hack basically allow them to read the title only - not the content. I don't remember the exactly location but it is on this board :smoke: :smoke:
can you explain what do you mean?
Reply With Quote
Reply


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 11:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11894 seconds
  • Memory Usage 2,320KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete