Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Embedded MP3 Attachment Player Details »»
Embedded MP3 Attachment Player
Version: 1.00, by ericgtr ericgtr is offline
Developer Last Online: Feb 2022 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.0.3 Rating:
Released: 04-16-2010 Last Update: 05-17-2010 Installs: 88
Template Edits
Re-useable Code  
No support by the author.

This is a simple modification that will embed an "attached" MP3 player so the file can be played inline. It uses a simple flash player from Google. There are many MP3 player mods but none that I could find that would actually play an attached file and in my community this was a the most missed feature since the upgraded to 4.x.

Unzip and then upload the attached audio_player.swf to your server, then modify the path where it says http://www.YOURSITE.com accordingly.

Open up postbit_attachment and add this at the very bottom:
HTML Code:
<!-- Embed Player -->
<vb:if condition="$show['member']">
<embed type="application/x-shockwave-flash" src="http://www.YOURSITE.com/audio-player.swf?audioUrl=attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />
</vb:if>
<BR />
<vb:if condition="$show['guest']">
<a href="/register.php">Register for free</a> today to download files or play them directly in our embedded media player
</vb:if>
<!-- /Embed Player -->
I have added a register option for guests, if you have attachments viewable by guests though feel free to strip that out of this code.

Download Now

File Type: txt mp3_player.txt (1.1 KB, 637 views)
File Type: zip audio_player.zip (68.2 KB, 749 views)

Screenshots

File Type: jpg mp3_player.jpg (106.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
andro140, gagan007

Comments
  #32  
Old 04-23-2010, 12:29 AM
Gamertype Gamertype is offline
 
Join Date: Mar 2010
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to limit what usergroups can upload mp3's as attachments?
Reply With Quote
  #33  
Old 04-23-2010, 01:10 AM
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 Gamertype View Post
Is there a way to limit what usergroups can upload mp3's as attachments?
Sure, Admin CP > Attachments > Attachment Permissions.
Reply With Quote
  #34  
Old 04-23-2010, 07:07 AM
Orakk's Avatar
Orakk Orakk is offline
 
Join Date: Nov 2007
Location: SouthOZ
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AURFSCAN View Post
Originally Posted by junaid

I have many attachment types like zip, tar etc
Is it possible to set player view only MP3 attachment type?


to have the player only visible for mp3.

Code:

<!-- Embed Player -->

<vb:if condition="$attachment[attachmentextension] == mp3">

<embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />
</vb:if>

<!-- /Embed Player -->
Thank you muchly, worked a treat. :up:
Reply With Quote
  #35  
Old 04-23-2010, 10:13 AM
junaid junaid is offline
 
Join Date: Oct 2005
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AURFSCAN View Post
Originally Posted by junaid

I have many attachment types like zip, tar etc
Is it possible to set player view only MP3 attachment type?


to have the player only visible for mp3.

Code:

<!-- Embed Player -->

<vb:if condition="$attachment[attachmentextension] == mp3">

<embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />
</vb:if>

<!-- /Embed Player -->
Thank you very much
it work fine
Reply With Quote
  #36  
Old 04-23-2010, 12:04 PM
Orakk's Avatar
Orakk Orakk is offline
 
Join Date: Nov 2007
Location: SouthOZ
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To get this to work in IE code below is working for us.

Code:
<!-- Embed Player -->
<vb:if condition="$attachment[attachmentextension] == mp3">
  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"  align="middle" height="27" width="400">
    <param name="quality" value="best">
    <param name="allowScriptAccess" value="never">
    <param name="wmode" value="window">
    <param name="movie"  value="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=attachment.php?{vb:raw  session.sessionurl}attachmentid={vb:raw  attachment.attachmentid}&amp;d={vb:raw attachment.dateline}"  flashvars="playerMode=embedded" />
  <embed type="application/x-shockwave-flash"  src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=attachment.php?{vb:raw  session.sessionurl}attachmentid={vb:raw  attachment.attachmentid}&amp;d={vb:raw attachment.dateline}"  width="400" height="27" allowscriptaccess="never" quality="best"  bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />
  </object>
</vb:if>
<!-- /Embed Player -->
Reply With Quote
  #37  
Old 04-23-2010, 01:55 PM
syrus.xl's Avatar
syrus.xl syrus.xl is offline
 
Join Date: Jun 2005
Location: In a cyber world...
Posts: 999
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have an error in your coding. The wmode parameter should be set to transparent, not window. Otherwise, any DHTML menus will drop behind the mp3 player.

Quote:
Originally Posted by Orakk View Post
To get this to work in IE code below is working for us.

Code:
<!-- Embed Player -->
<vb:if condition="$attachment[attachmentextension] == mp3">
  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"  align="middle" height="27" width="400">
    <param name="quality" value="best">
    <param name="allowScriptAccess" value="never">
    <param name="wmode" value="window">
    <param name="movie"  value="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=attachment.php?{vb:raw  session.sessionurl}attachmentid={vb:raw  attachment.attachmentid}&amp;d={vb:raw attachment.dateline}"  flashvars="playerMode=embedded" />
  <embed type="application/x-shockwave-flash"  src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=attachment.php?{vb:raw  session.sessionurl}attachmentid={vb:raw  attachment.attachmentid}&amp;d={vb:raw attachment.dateline}"  width="400" height="27" allowscriptaccess="never" quality="best"  bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />
  </object>
</vb:if>
<!-- /Embed Player -->
Reply With Quote
  #38  
Old 04-27-2010, 05:37 PM
Gamertype Gamertype is offline
 
Join Date: Mar 2010
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ericgtr View Post
Sure, Admin CP > Attachments > Attachment Permissions.
I have my mods/admins set to a 50MB upload and VB keeps failing? Any reason why?
Reply With Quote
  #39  
Old 04-27-2010, 06:26 PM
goran424's Avatar
goran424 goran424 is offline
 
Join Date: Feb 2010
Location: Thailand
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gamertype View Post
I have my mods/admins set to a 50MB upload and VB keeps failing? Any reason why?
Same reason as me as mentioned at previous page of this thread.

After contacting server host and telling them about the problem, they fixed it at their end. I suggest you try the same.

Here is the live demo, works perfect now:

http://ghostriders-thailand.com/foru...ts&p=69#post69
Reply With Quote
  #40  
Old 04-28-2010, 12:40 AM
Orakk's Avatar
Orakk Orakk is offline
 
Join Date: Nov 2007
Location: SouthOZ
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by syrus.xl View Post
You have an error in your coding. The wmode parameter should be set to transparent, not window. Otherwise, any DHTML menus will drop behind the mp3 player.
Thank you, will fix.

Cheers. :up:
Reply With Quote
  #41  
Old 04-29-2010, 01:06 PM
mactelesis mactelesis is offline
 
Join Date: Sep 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where is "postbit_attachment" located?
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 09:55 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.05744 seconds
  • Memory Usage 2,356KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_html
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete