HTML5AV module with D 7.0.9

What does it take to get the HTML5AV module to work with D 7.0.9?

In the config I changed the compatible with line and installed it.

I am sure there are some core changes, just not sure where to look.

I need this for my mobile viewers.  Since I went completely responsive, a LOT of people are liking my site on their phone, just can't play videos.

Thanks!

http://www.mytikibar.com
Quote · 14 Jun 2014

You didn't say if you uploaded anything and tried to play it.

The ffmpeg versions are different between 7.0.9 and 7.1.x.

Sounds are processed by it too now for HTML5 playback.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 14 Jun 2014

Why won't you upgrade your site to 7.1.4, instead of running a two year old version of Dolphin?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 14 Jun 2014

There are core file changes, possibly a decent number. The module basically flips a switch and tells Dolphin to convert to some extra formats and display a HTML5 player when able. I know the extra converter code is in the Flash apps' /inc files.

 

I agree with Houston. Why not upgrade to Dolphin 7.1?

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 14 Jun 2014

He may be reluctant to upgrade a working site that is dong the job that has code changes; just look at how many modules in the market require you to go in and change core files.  It is not always an easy job to upgrade a site.  I just applied 7.1.2 to my test site and found some things broken, I have to track down the errors and fix them and roll them back into the upgrade and then retest the upgrade again.

Geeks, making the world a better place
Quote · 14 Jun 2014

Houston, basically, I've been doing code mods on 7.0.9 for 2 years, and there are a tremendous amount to make the privacy work right (that was the BIGGEST headache).  I had to track down all the code that displays any kind of member information and not allow it to be displayed to a blocked member. 

Some of the changes I have included were suggestions that you posted and I like how it works.

I have my site working very well with PC's and mobile now.  Another long adventurous journey (which houston gave me a HUGE tip on as well!).

I would pretty much have to quit my real job and code for months to get 7.1.4 up to what I need.  I can't do that. LOL

I did some quick grep searches to try and find the code changes but was unsuccessful.

I was kind of hoping it was a couple of core changes I could go in and modify.

 

 

http://www.mytikibar.com
Quote · 15 Jun 2014

Ok, rather painless so far.

copied flash/modules/video/inc folder from 7.1.4

had to add the follwing functions in inc/classes/BxDolImageResize.php

function getAverageColor($sPath)

function _getAverageColorGD($sPath)

 function _getAverageColorImageMagic($sPath)

I replaced FFMPEG.EXE

I upload a video, and get a webm file with the others, however, I do not get the html 5 video player.

I tried my test 7.1 site with same video and same browser and I do get HTML 5.  So I am missing 1 last step!

http://www.mytikibar.com
Quote · 17 Jun 2014

The HTML5 video player is handled by the browser; each are a bit different.

To show a video in HTML5, this is all you need:

Example

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
 
Geeks, making the world a better place
Quote · 17 Jun 2014

Right, but what triggers dolphin to display the webm file instead of the m4v?

http://www.mytikibar.com
Quote · 17 Jun 2014

 

Right, but what triggers dolphin to display the webm file instead of the m4v?

 OK, searching Dolphin 7.1.4 for </video> I find it located in BxH5avModule.php at line 94 and 349 so that is where I would start.

At line 89:

                 $sOverride = '
                        <video controls preload="auto" autobuffer ' . $sAutoPlay . $sPoster . ' style="width:100%; height:' . getSettingValue('video', 'player_height') . 'px;" id="' . $sId . '">
                            ' . $sSourceWebm . '
                            <source src="' . BX_DOL_URL_ROOT . "flash/modules/video/get_file.php?id=" . $iFileId . "&ext=m4v&token=" . $sToken . '" />
                            ' . (BX_H5AV_FALLBACK ? $sFlash : '<b>Can not playback media - your browser doesn\'t support HTML5 audio/video tag.</b>') . '
                        </video>

Geeks, making the world a better place
Quote · 17 Jun 2014

In the file modules/boonex/video/classes/BxVideosTemplate.php

 

Need to edit     function getFileConcept to this.

Now, it plays webm files!

    function getFileConcept ($iFileId, $aExtra = array()) {
        $iFileId = (int)$iFileId;
        $sOverride = false;
        $oAlert = new BxDolAlerts($this->_oConfig->getMainPrefix(), 'display_player', $iFileId, getLoggedId(), array('extra' => $aExtra, 'override' => &$sOverride));
        $oAlert->alert();
        if ($sOverride)
            return $sOverride;

        $iFileId = (int)$iFileId;

        if(empty($aExtra['ext']))
            $sPlayer = getApplicationContent('video','player',array('id' => $iFileId, 'user' => $this->iViewer, 'password' => clear_xss($_COOKIE['memberPassword'])),true);
        else {

problem is, SOME of my old videos now don't play.  :(

Still tracking this down.

http://www.mytikibar.com
Quote · 17 Jun 2014

 

problem is, SOME of my old videos now don't play.  :(

Still tracking this down.

 Yes, the older files before HTML5 are suppose to fall back to using the flash player; so you need to track down the parts that does that.

Geeks, making the world a better place
Quote · 17 Jun 2014

yep!  That's the issue.

  in modules/boonex/videos/classes/BxVideosTemplate,php

if I comment out thi

  $sOverride = false;
        $oAlert = new BxDolAlerts($this->_oConfig->getMainPrefix(), 'display_player', $iFileId, getLoggedId(), array('extra' => $aExtra, 'override' => &$sOverride));
        $oAlert->alert();
        if ($sOverride)
           return $sOverride;

Then the HTML5 work doesn't and the flash player does work.

So... somewhere in the HTML5AV module that triggers the flash player the code is slightly different.

I just am not sure where.

I do see bits of javascript in the flash window when the flash player fallback fails also.

http://www.mytikibar.com
Quote · 17 Jun 2014

Ok!  Almost to the end of this journey!

7.0.9 has an older version of jquery so....

in modules/boonex/html5av/BxH5avModule.php

find all the occurrences of

eFile.on("canplay", function (e)

and change to

eFile.bind("canplay", function (e)

 

and finally in inc/utils.inc.php

replace

function bx_js_string ($mixedInput) {
    $aUnits = array(
        "\"" => "&quot;",
        "'" => "&apos;",
        "\n" => " ",
        "\r" => "",
    );
    return str_replace(array_keys($aUnits), array_values($aUnits), $mixedInput);
}

 

function bx_js_string ($mixedInput, $iQuoteType = BX_ESCAPE_STR_AUTO)
{
    $aUnits = array(
        "\n" => "\\n",
        "\r" => "",
    );
    if (BX_ESCAPE_STR_APOS == $iQuoteType) {
        $aUnits["'"] = "\\'";
        $aUnits['<script'] = "<scr' + 'ipt";
        $aUnits['</script>'] = "</scr' + 'ipt>";
    } elseif (BX_ESCAPE_STR_QUOTE == $iQuoteType) {
        $aUnits['"'] = '\\"';
        $aUnits['<script'] = '<scr" + "ipt';
        $aUnits['</script>'] = '</scr" + "ipt>';
    } else {
        $aUnits['"'] = '&quote;';
        $aUnits["'"] = '&apos;';
        $aUnits["<"] = '&lt;';
        $aUnits[">"] = '&gt;';
    }
    return str_replace(array_keys($aUnits), array_values($aUnits), $mixedInput);
}

 

Also, in flash/modules/video

replace get_file.php with the one with D 7.1.x

http://www.mytikibar.com
Quote · 18 Jun 2014

And the final piece...

in the flash/modules/videos/files folder

../../global/apps/ffmpeg -i myfiletoconvert.m4v output.webm

That will create a webm file from the m4v that you specify.

 

http://www.mytikibar.com
Quote · 18 Jun 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.