I decided to go forward with the link.txt option because then video streaming stays inside TWG and you can stil use the arrow up or go straight to different directory by clicking where you want to go left-up.
I took the time to implement it as much as possible without changing to much of the code. I am not a regular programmer so perhaps I did some things not the best way, but it works exactly how I wanted and personaly I find it really looks great like this.
I did the following:
In the directory where you put the video streaming files there has to be a video.txt file, this file is empty or not doesn't matter. The purpose of this file is to trigger video streaming.
In the directory there has to be a *.wmv file with the belonging *.JPG file (watch the capitals).
Add some code in image.inc.php (just above $linkfilename):
$videofilename = $basedir . "/" . $twg_album . "/video.txt";
// we enable videostreaming
if (file_exists($videofilename)) { // video file exists !!!
include ('videostreaming.inc.php');
}
Add file videostreaming.inc.php (in the inc directory):
<?php
$linkmoviefile =str_replace('JPG', 'wmv', $image);
$embedstringbegin = "<table border='0' cellpadding='0' align='center'> <tr><td> <OBJECT id='mediaPlayer' width='320' height='285' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' 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'> <param name='Filename' value=";
$embedstringmidden = "<param name='animationatStart' value='true'> <param name='transparentatStart' value='true'> <param name='autoStart' value='true'> <param name='showControls' value='true'> <param name='loop' value='false'> <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols='true' showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width='320' height='285' src='";
$embedstringeind = "' autostart='true' designtimesp='5311' loop='false'></EMBED></table>";
$embedstring ="'" . "/" . $basedir . "/" . $twg_album . "/" . $linkmoviefile . "'";
echo $embedstringbegin;
echo $embedstring;
echo $embedstringmidden;
echo $embedstring;
echo $embedstringeind;
?>
Further:
In the file config.php I put in wmv by the other_file_formats.
The same could be easely possible with embedded java. The only thing you would have to change is the extentions and put je java code in videostreaming.inc.php instead of the code I used. Or put a file besides it and change the include towards this file.
The best way is to add some lines in image.inc.php like I did and include the java code file.
In this way you enable support for embedded java and windows media player.
|