Add capability to play HTML5 native formats without bbcode

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

Thank you shortmort37 for your work. I'll install it... ;)

Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

I tested on my forum.

I have just 1 problem:
old attachments (mp3) do not work

error:
type mime not support

User avatar
shortmort37
Registered User
Posts: 504
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: Add capability to play HTML5 native formats without bbcode

Post by shortmort37 »

Sorry to just now be seeing this, Tabitha! Hmmm... I haven't yet ported the mp3 hack to my production forum, where I have mp3's uploaded (for playing with a downloaded player). I'll try it there, and get back.

Dan

User avatar
shortmort37
Registered User
Posts: 504
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: Add capability to play HTML5 native formats without bbcode

Post by shortmort37 »

BTW, I said:
shortmort37 wrote: I've revised the hacks above to include utilizing the native capability of HTML5 browsers to play MP3 files.


Did you incorporate the update to styles/prosilver/template/attachment.html, and the additional change in phpbb/mimetype/extension_guesser.php? And add mp3 to the HTML5 extension group?

Dan

Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

in the phpbb/mimetype/extension_guesser.php
I have

Code: Select all

'mp3'		=> 'audio/mp3',
what should I do please ?

User avatar
shortmort37
Registered User
Posts: 504
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: Add capability to play HTML5 native formats without bbcode

Post by shortmort37 »

Tabitha,

My initial post did not include support for mp3's. In adding it, I edited my initial post to include the change to extension_guesser.php, but also to make further revisions to attachment.html:
shortmort37 wrote:Find in styles/prosilver/template/attachment.html:

Code: Select all

      <!-- ELSEIF _file.S_QUICKTIME_FILE -->
         <object id="qtstream_{_file.ATTACH_ID}" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="320" height="285">
            <param name="src" value="{_file.U_DOWNLOAD_LINK}" />
            <param name="controller" value="true" />
            <param name="autoplay" value="false" />
            <param name="type" value="video/quicktime" />
            <embed name="qtstream_{_file.ATTACH_ID}" src="{_file.U_DOWNLOAD_LINK}" pluginspage="http://www.apple.com/quicktime/download/" enablejavascript="true" controller="true" width="320" height="285" type="video/quicktime" autoplay="false"></embed>
         </object>
After, add:

Code: Select all

      <!-- ELSEIF _file.S_H5_FILE -->
         <!-- IF _file.MIMETYPE == 'audio/mp3' -->
            <audio controls name="media">
               <source src="{_file.U_DOWNLOAD_LINK}" type="{_file.MIMETYPE}">
            </audio>
         <!-- ELSE -->
            <video controls name="media">
               <source src="{_file.U_DOWNLOAD_LINK}" type="{_file.MIMETYPE}">
            </video>
         <!-- ENDIF -->
Did you make that change? And, did you add mp3 to the HTML5 extension group, along with mp4, webm and ogv?

Dan
Last edited by shortmort37 on Thu Sep 10, 2015 8:44 pm, edited 1 time in total.

User avatar
shortmort37
Registered User
Posts: 504
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: Add capability to play HTML5 native formats without bbcode

Post by shortmort37 »

shortmort37 wrote: I haven't yet ported the mp3 hack to my production forum, where I have mp3's uploaded (for playing with a downloaded player). I'll try it there, and get back.

Dan
I just now did this. Formerly, the mp3's on my production forum required the JPlayer download to play. I eliminated that bbcode, ported my hack, and the mp3's that were previously loaded now play natively in an HTML5 browser.

Looks like you missed something in my revisions, Tabitha.

Dan

Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

Hello shortmort37,
I already have this code in my attachment.html

Code: Select all

      <!-- ELSEIF _file.S_H5_FILE -->
         <!-- IF _file.MIMETYPE == 'audio/mp3' -->
            <audio controls name="media">
               <source src="{_file.U_DOWNLOAD_LINK}" type="{_file.MIMETYPE}">
            </audio>
         <!-- ELSE -->
            <video controls name="media">
               <source src="{_file.U_DOWNLOAD_LINK}" type="{_file.MIMETYPE}">
            </video>
         <!-- ENDIF -->

Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

I remove the bbcode

Code: Select all

           <param name="movie" value="images/scmp3player.swf">
           <param name="FlashVars" value="playerID=1&bg=0x9DA5BF&leftbg=0xeeeeee&lefticon=0x666666&rightbg=0x394670&rightbghover=0x999999&righticon=0xE7E7EF&righticonhover=0xffffff&text=0x666666&slider=0x666666&track=0xFFFFFF&border=0x666666&loader=0x9FFFB8&loop=no&autostart=no&soundFile={URL}">
           <param name="quality" value="high">
           <param name="menu" value="false">
           <param name="wmode" value="transparent">
        </object>
And I can't play older attachments

User avatar
shortmort37
Registered User
Posts: 504
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: Add capability to play HTML5 native formats without bbcode

Post by shortmort37 »

Did you create an HTML5 extension group, and did you add mp3 to it?

Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

Yes ;)
Image

User avatar
shortmort37
Registered User
Posts: 504
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: Add capability to play HTML5 native formats without bbcode

Post by shortmort37 »

Two questions:

1) Does the the mod work if you now add an mp3?

2) Your bbcode and player were different than mine. If you go into an older post and edit out the bbcode tags, does it now play natively? (Obviously, this will only work if (1) works.)

Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

1) yes
2) no
;)

User avatar
shortmort37
Registered User
Posts: 504
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton
Contact:

Re: Add capability to play HTML5 native formats without bbcode

Post by shortmort37 »

Tabitha2 wrote: 2) no
Try it, and see if it now plays. Sorry if your mileage varies from mine... You might try defining a [mp3]...[/mp3] bbcode that does nothing at all, i.e., so its presence in your existing posts defaults to HTML5 behavior.

Dan

Tabitha2
Registered User
Posts: 37
Joined: Wed Oct 17, 2012 7:09 am

Re: Add capability to play HTML5 native formats without bbcode

Post by Tabitha2 »

2) don't work I tried
;)

Post Reply

Return to “Extension Requests”