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

Reply
 
Thread Tools
HTML5 MP3/MP4 Attachment Player for VB3/VB4 Details »»
HTML5 MP3/MP4 Attachment Player for VB3/VB4
Version: 1.00, by ShawneyJ ShawneyJ is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.8.x Rating:
Released: 10-03-2014 Last Update: 10-03-2014 Installs: 18
Template Edits
 
No support by the author.

For some reason, i enjoy working with all different players from around the net, like in what ways can a video/audio player help in the ways of vbulletin 3, to completely one day have vb3 players all compatible with HTML5 with the flash fall back. well, after testing with many HTML5 players, it seems, for this mod, so far mediaelement comes out on top. mind you, lets get one thing strait, at this stage, you just cannot please every single browser or device. but, this is at least, a great start for attachments in threads/posts using HTML5 with flash fall back. and mediaelement is updating all the time, so maybe, in the end, this player will work for everything, fingers crossed!

This is a very strait forward install of a HTML5/Flash Fallback Player uploaded in your MP3/MP4 uploaded attachments to threads/posts.

How to install:

1. upload the attached zip to your forums root.
2. in your postbit_attachment template, add this code to the very bottom:
Code:
<!-- Embed Player MP4 -->
<if condition="$attachment[attachmentextension] == mp4">
<if condition="$show['member']">
<div><video width="320" height="240" poster="/mediaelement/build/bg.png" controls="controls" preload="none">
    <source type="video/mp4" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" />
    <object width="320" height="240" type="application/x-shockwave-flash" data="/mediaelement/build/flashmediaelement.swf">
        <param name="movie" value="/mediaelement/build/flashmediaelement.swf" />
        <param name="flashvars" value="controls=true&file=attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" />
        <!-- Image as a last resort -->
        <img src="/mediaelement/build/bg.png" width="320" height="240" title="No video playback capabilities" />
    </object>
</video></div><br />
</if></if>
<!-- /Embed Player MP4 -->

<!-- Embed Player MP3 -->
<if condition="$attachment[attachmentextension] == mp3">
<if condition="$show['member']">
<div><audio width="320" height="30" controls="controls" preload="none">
<source type="audio/mp3" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" />
    <object width="320" height="30" type="application/x-shockwave-flash" data="/mediaelement/build/flashmediaelement.swf">
        <param name="movie" value="/mediaelement/build/flashmediaelement.swf" />
        <param name="flashvars" value="controls=true&file=attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" />
    </object>
</audio></div><br />
</if></if>
<!-- /Embed Player MP3 -->

3.Add this code to the bottom of your Headinclude Template: Note, Full URL is needed to support Safari.
Code:
<script src="http://www.YOURSITE.com/mediaelement/build/jquery.js" type="text/javascript">
</script>
<script src="http://www.YOURSITE.com/mediaelement/build/mediaelement-and-player.min.js" type="text/javascript">
</script>
<link rel="stylesheet" href="http://www.YOURSITE.com/mediaelement/build/mediaelementplayer.css" type="text/css" />
4.Add this code to the bottom of your Footer Template:
Code:
<script type="text/javascript">
//<![CDATA[
// using jQuery
$('video,audio').mediaelementplayer();
//]]>
</script>

5.Upload the attached mp4.gif to your images/attach folder.

6.Add New Extension for MP3/MP4 Attachments. See Read Me Text on how to do this.

Please Note: For MP4 to upload and work/play videos all the way through. Its best that you change the Storage Type: Attachments to a Directory Folder rather than uploading into your Database.

For VB4, all template edits are the same, apart from, you would skip step.2 above and use this code in your postbit_attachment template, add this code to the very bottom:
Code:
<!-- Embed Player MP4 -->
<vb:if condition="$attachment[attachmentextension] == mp4">
<vb:if condition="$show['member']">
<video width="320" height="240" poster="/mediaelement/build/bg.png" controls="controls" preload="none">
<source type="video/mp4" src="attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" />
    <object width="320" height="240" type="application/x-shockwave-flash" data="/mediaelement/build/flashmediaelement.swf">
        <param name="movie" value="/mediaelement/build/flashmediaelement.swf" />
        <param name="flashvars" value="controls=true&file=attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" />
        <img src="/mediaelement/build/bg.png" width="320" height="240" title="No video playback capabilities" />
    </object>
</video>
</vb:if></vb:if>
<!-- /Embed Player MP4 -->

<!-- Embed Player MP3 -->
<vb:if condition="$attachment[attachmentextension] == mp3">
<vb:if condition="$show['member']">
<audio width="320" height="30" controls="controls" preload="none">
<source type="audio/mp3" src="attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" />
    <object width="320" height="30" type="application/x-shockwave-flash" data="/mediaelement/build/flashmediaelement.swf">
        <param name="movie" value="/mediaelement/build/flashmediaelement.swf" />
        <param name="flashvars" value="controls=true&file=attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" />
    </object>
</audio>
</vb:if></vb:if>
<!-- /Embed Player MP3 -->

Download Now

File Type: txt Read Me - New Extension for MP3-MP4.txt (914 Bytes, 88 views)
File Type: zip mediaelement.zip (950.7 KB, 113 views)

Screenshots

File Type: png mp3-mp4-demo-cap.png (154.7 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
Crossbow, fariborz khan, Max Taxable, tbworld, wangyu1314

Comments
  #2  
Old 10-04-2014, 08:12 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for sharing @ShawneyJ.

You are right, finding the right media application for your collective audience can be hell, or you can just store the media in three formats -- which is always fun.
Reply With Quote
2 благодарности(ей) от:
fariborz khan, ShawneyJ
  #3  
Old 10-29-2014, 12:12 PM
RELAX13 RELAX13 is offline
 
Join Date: Nov 2013
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good Id
Reply With Quote
  #4  
Old 11-02-2014, 03:19 PM
fariborz khan's Avatar
fariborz khan fariborz khan is offline
 
Join Date: Jul 2007
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi:
I go to your site and play music and video by my all device I know it not work in android 4.4 stock browser but it work in other browser like dolphin and firefox and opera you say you think it work on vb5 connect but I can not find postbit_attachment template for adding your code can you release this player for vb5 connect I need it.
I see it work in iphone 5s in sgsIII stock browser
I think android 4.4 not support Html5.
I MOTM Nomination for your soft.
thanks in advance
Reply With Quote
  #5  
Old 11-02-2014, 08:59 PM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fariborz khan View Post
hi:
I go to your site and play music and video by my all device I know it not work in android 4.4 stock browser but it work in other browser like dolphin and firefox and opera you say you think it work on vb5 connect but I can not find postbit_attachment template for adding your code can you release this player for vb5 connect I need it.
I see it work in iphone 5s in sgsIII stock browser
I think android 4.4 not support Html5.
I MOTM Nomination for your soft.
thanks in advance
i have only ever tested this on vb4, which does seem to work better than vb3 and i don't know why. this player does update from time to time, so in the long run, lets hope it ends up playing in a lot more devices.
i don't have a vb5 to even try to test this out on mate, sorry.
so just to confirm, postbit_attachment is not in Postbit Templates area for vb5?
Reply With Quote
  #6  
Old 11-02-2014, 09:39 PM
fariborz khan's Avatar
fariborz khan fariborz khan is offline
 
Join Date: Jul 2007
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi thanks for your help
I create a admin account for you as soon as possible that you can work on vb5
Reply With Quote
  #7  
Old 11-02-2014, 09:53 PM
fariborz khan's Avatar
fariborz khan fariborz khan is offline
 
Join Date: Jul 2007
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I send pm to you please see that
thanks
Reply With Quote
  #8  
Old 11-02-2014, 10:33 PM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i logged in, but all i see is announcements and logs. ive never used vb5, but im guessing i'll need template edit permissions mate please.
Reply With Quote
  #9  
Old 11-02-2014, 10:42 PM
fariborz khan's Avatar
fariborz khan fariborz khan is offline
 
Join Date: Jul 2007
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

one min plz
Reply With Quote
  #10  
Old 11-02-2014, 10:52 PM
fariborz khan's Avatar
fariborz khan fariborz khan is offline
 
Join Date: Jul 2007
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

please check again
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:13 AM.


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.06585 seconds
  • Memory Usage 2,344KB
  • Queries Executed 24 (?)
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_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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (7)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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