• Welcome to TodayPlus Boards v2.
 

how to play divX converted *.AVIs / *.divX videos ?

Started by tikko, October 10, 2007, 11:38:23 AM

Previous topic - Next topic

tikko

Hello Community :)
at first kudos to the maker(s) of SPGM-Vid! A great AddOn!

I try to integrate the divx player for my divx avis but i am still at a loss.
So far i modified the spgm-vid.php as follows:




//The Object & Embed Tag for the Video Clip

if ( $arrVideoDim[2] == 'real' ) {
print '          <table class="'.CLASS_TABLE_SHADOWS.'">'."\n";

(.....)


// DIVX Player
} elseif ( ($arrVideoDim[2] == 'avi' or $arrVideoDim[2] == 'dvx') ) {
print '          <object id="DIVXPlayer" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+64).'">'."\n";
        print '            <param name="src" value="'.$strVideoURL.'" />'."\n";
        print '            <param name="autoPlay" value="false" />'."\n";
print '            <embed type="video/divx" pluginspage="http://go.divx.com/plugin/download/" src="'.$strVideoURL.'" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+44).'" autoPlay="false">'."\n";
        print '            </embed> '."\n";
        print '          </object>'."\n";


// Shockwave Player
} elseif ( $arrVideoDim[2] == 'swf' ) {

(.....)




But it still does not work. Where is the bug, what i have to fix?
I think i have to go in for $arrVideoDim ...

Thanks a lot for help in advance!

jhollin1138

I haven't tried everything myself yet, but this should work.  If you want AVI files to default to play to DivX and not Windows Media Player, do the following.

Open "spgm-vid.php" and find this: // Windows Media Player
} elseif ( ($arrVideoDim[2] == 'asf' or $arrVideoDim[2] == 'riff') ) {
print '          <object id="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+64).'">'."\n";
print '            <param name="url" value="'.$strVideoURL.'" />'."\n";
print '            <param name="AutoStart" value="true" />'."\n";
print '            <param name="EnableTracker" value="false" />'."\n";
print '            <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'.$strVideoURL.'" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+44).'" autostart="1" showcontrols="1">'."\n";
print '            </embed> '."\n";
print '          </object>'."\n";

Replace it with this: // Windows Media Player
} elseif ( $arrVideoDim[2] == 'asf' ) {
print '          <object id="MediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+64).'">'."\n";
print '            <param name="url" value="'.$strVideoURL.'" />'."\n";
print '            <param name="AutoStart" value="true" />'."\n";
print '            <param name="EnableTracker" value="false" />'."\n";
print '            <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'.$strVideoURL.'" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+44).'" autostart="1" showcontrols="1">'."\n";
print '            </embed> '."\n";
print '          </object>'."\n";

// DiVX
} elseif ( $arrVideoDim[2] == 'riff' ) {
print '          <object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+20).'" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">'."\n";
print '            <param name="src" value="'.$strVideoURL.'" />'."\n";
print '            <param name="custommode" value="Stage6" />'."\n";
print '            <param name="autoPlay" value="false" />'."\n";
print '            <embed type="video/divx " src="'.$strVideoURL.'" custommode="Stage6" width="'.$arrVideoDim[0].'" height="'.($arrVideoDim[1]+20).'" autoplay="false" pluginspage="http://go.divx.com/plugin/download/">'."\n";
print '            </embed>'."\n";
print '          </object>'."\n";


There is additional code to change to fully support DivX.  For example the default thumbnail and a link to the DivX player (replace the WMP icon with a DivX icon) but this should at least get you going on the video side.
Jim H

tikko


hey jhollin1138 it works :)  :clap:
but with Mozilla Firefox only.  :-?

In IE i get the msg "divx player cannot play this file"
(find the screenshot attached)

and in k-meleon it doesn't always play. Sometimes the buffering account stays by 0% though the loading bar is complete ready.


jhollin1138 where do i find this additional code to change to fully support DivX ?

jhollin1138

Quote from: tikko on October 15, 2007, 09:01:18 AMhey jhollin1138 it works :)  :clap:
but with Mozilla Firefox only.  :-?

In IE i get the msg "divx player cannot play this file"
(find the screenshot attached)

and in k-meleon it doesn't always play. Sometimes the buffering account stays by 0% though the loading bar is complete ready.
This isn't an issue with SPGM-Vid but a problem with the other browsers and/or DivX.   SPGM-Vid just determines the correct "object/embed" html code to use, beyond that SPGM-Vid has no control of if the video play or not.

Quote from: tikko on October 15, 2007, 09:01:18 AMjhollin1138 where do i find this additional code to change to fully support DivX ?
As before, I haven't tried everything myself yet, but this should work.  To fully support DivX, you will need to do the following.

Open "flavors/default/spgm.thm" and find this:?>
Before, add:# image icon for DivX Player
$spgm_cfg['theme']['DXVideoImage'] = 'dx.gif';

# default thumbnail for DivX Player Videos
$spgm_cfg['theme']['DXVideoTHB'] = 'thb_dx.jpg';


Open "spgm-vid.lib.php" and find this:$spgm_cfg['global']['supportedVidExtensions']
= array('.asf', '.wmv', '.avi', '.mov', '.qt', '.rm', '.swf', '3gp');    // supported video file extensions

Replace it with this:$spgm_cfg['global']['supportedVidExtensions']
= array('.asf', '.wmv', '.avi', '.mov', '.qt', '.rm', '.swf', '.3gp', '.divx');    // supported video file extensions


Open "spgm-vid.php" and find this:$spgm_cfg['theme']['SWVideoTHB']          = '';
After add:$spgm_cfg['theme']['DXVideoImage'] = '';
$spgm_cfg['theme']['DXVideoTHB']          = '';

Find this: if ( ($arrVideoInfo[2] == 'asf' or $arrVideoInfo[2] == 'riff') ) {
$strThumbnailPath = $spgm_cfg['theme']['MPVideoTHB'];

Replace it with this: if ( $arrVideoInfo[2] == 'asf' ) {
$strThumbnailPath = $spgm_cfg['theme']['MPVideoTHB'];
} elseif ( $arrVideoInfo[2] == 'riff' ) {
$strThumbnailPath = $spgm_cfg['theme']['DXVideoTHB'];

Find this: array('RPVideoImage', 'Get Real Player!', CLASS_IMG_FOLDER, 'RP'),
After add: array('DXVideoImage', 'Get DivX Player!', CLASS_IMG_FOLDER, 'DX'),
Find this: // key in $spgm_cfg
array('MPVideoTHB'),

After add: array('DXVideoTHB'),
Find this: if ( ($arrVideoDim[2] == 'asf' or $arrVideoDim[2] == 'riff') ) {
print '<a href="http://www.microsoft.com/windows/windowsmedia/player/download/">'.$spgm_cfg['theme']['MPVideoImage'].'</a>';

Replace it with this: if ( $arrVideoDim[2] == 'asf' ) {
print '<a href="http://www.microsoft.com/windows/windowsmedia/player/download/">'.$spgm_cfg['theme']['MPVideoImage'].'</a>';
} elseif ( $arrVideoDim[2] == 'riff' ) {
print '<a href="http://go.divx.com/plugin/download/">'.$spgm_cfg['theme']['DXVideoImage'].'</a>';


In addition to all the above changes, copy the attached DivX icon and thumbnail to your "flavors/default/".
Jim H