1)If the file_location is incorrect, the php still spits out the embed code (without the height and width obviously). What am I doing wrong (I want it to echo "nope" if the file_location doesn't exist)?
2)Also is there a way to dynamically include the url for the src attribute?
Thanks a lot. This is a great library (and I am a php novice).
Here is the code:
- Code: Select all
<?php
include_once('/home/.saffron/mysite.com/incl/php/getid3/getid3.php');
$getID3 = new getID3;
// File to get info from
$file_location = '/home/.saffron/mysite.com/Penguin/sd.mov';
// Get information from the file
$fileinfo = $getID3->analyze($file_location);
getid3_lib::CopyTagsToComments($fileinfo);
// Output results
if (!empty($fileinfo)) {
echo '
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'.$fileinfo['video']['resolution_x'].'"height="'.$fileinfo['video']['resolution_y'].'">
<param name="src" value="http://mysite.com/Penguin/sd.mov">
<param name="controller" value="true">
<param name="autoplay" value="true">
<param name="kioskmode" value="true">
<embed src="http://mysite.com/Penguin/sd.mov" width="'.$fileinfo['video']['resolution_x'].'"height="'.$fileinfo['video']['resolution_y'].'" autoplay=false kioskmode=true controller=true bgcolor="000000" border=0 pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed>
</object>
';
}
else{
echo 'nope';
}
?>
