embedding quicktime

The place for "I can't figure out how to..." questions.

embedding quicktime

Postby littleeye » Fri Jan 20, 2006 6:49 pm

I am having trouble getting this to work. Specifically:
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';
}

?>
littleeye
User
 
Posts: 4
Joined: Fri Jan 20, 2006 6:33 pm

Postby littleeye » Fri Jan 20, 2006 6:57 pm

I should also say that the php works fine when I have the correct file_location listed. (That is to say, the problem arises when I don't want to embed any quicktime file).

Also, is it possible to use the url for the file_location (http://mysite.com/Penguin/sd.mov)? It appears that it is not.

Thanks.
littleeye
User
 
Posts: 4
Joined: Fri Jan 20, 2006 6:33 pm

Postby James Heinrich » Fri Jan 20, 2006 7:24 pm

$file_location needs to be a local file, not a URL.

If you want to check for file existance:
Code: Select all
if (file_exists($file_location)) {
$fileinfo will always contain some information, if only an error message, whether the file exists or not.
James Heinrich
getID3() v1 developer
 
Posts: 1203
Joined: Fri May 04, 2001 11:00 am
Location: London, ON, Canada

Postby littleeye » Fri Jan 20, 2006 10:08 pm

Thanks a lot. That worked perfectly. I have one last quick question. How would I set this up to add a few extra pixels to the height of the quicktime player (it looks as though the player is getting cut in half). Thanks a ton. This is a huge help.


Code: Select all
<?php
include_once('/home/mysite.com/incl/php/getid3/getid3.php');

$getID3 = new getID3;

// File to get info from
$file_location = '/home/mysite.com/Penguin/sarapreview.mov';

// Get information from the file
$fileinfo = $getID3->analyze($file_location);
getid3_lib::CopyTagsToComments($fileinfo);

// Output results

if (file_exists($file_location)) {
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/sarapreview.mov">
<param name="controller" value="true">
<param name="autoplay" value="true">
<param name="kioskmode" value="true">
<embed src="http://mysite.com/Penguin/sarapreview.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';
}

?>
littleeye
User
 
Posts: 4
Joined: Fri Jan 20, 2006 6:33 pm

Postby littleeye » Fri Jan 20, 2006 10:37 pm

Hey, I figured it out was easy enough. Thanks a ton for this library. Super useful.
littleeye
User
 
Posts: 4
Joined: Fri Jan 20, 2006 6:33 pm


Return to Support 1.x

Who is online

Users browsing this forum: mrhdestt, Suttonvfd and 4 guests

cron