Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari & QT6.1 = qtl bug



Kuniyoshi:

I've got a perl cgi that generates qtl files that works fine with Safari. You have to make sure that the mime type is returned as "application/x-quicktime-reference".

It is important to target quicktime player when using qtl files, and use an embedded http movie to link to the qtl file (using either the href parameter or autohref plug-in parameters): Using the object/embed tag to embed a movie from your web server that references a qtl file and targets QuickTime Player should work.

Here is the perl script for anyone that is interested. (It is pretty straight-forward). Since qtl files are just text files, creating them on the fly with a script can be very useful. This script can be saved to a text file and placed in your web server's cgi-bin directory with execute permissions.

# copy an paste this into a text editor
require 5;
use strict;
use CGI;
$CGI::DISABLE_UPLOADS = 1; #disable any attempt to upload file via this cgi
$CGI::POST_MAX = 512; #set the maximum input for post to 512 bytes


my ($url, $fullscreen, $autoplay, $quitwhendone);
($url, $fullscreen, $autoplay, $quitwhendone) = split /,/,$ENV{'QUERY_STRING'};


# return the qtl for mov, mp4 or unicast sdp files
print "Content-type: application/x-quicktime-reference\n\n";
print <<XMLHEAD;
<?xml version="1.0"?>
<?quicktime type="application/x-quicktime-media-link"?>
XMLHEAD

if (($fullscreen eq "false") || ($fullscreen eq "")) {
# if fullscreen parameter is false use this embed statement
print "<embed src=\"$url\" autoplay=\"$autoplay\" quitwhendone=\"$quitwhendone\"\/>";
} else {
# if fullscreen parameter is set use this embed statement
# Note: fullscreen .qtl files may not be rendered correctly
print "<embed src=\"$url\" autoplay=\"$autoplay\" quitwhendone=\"$quitwhendone\" fullscreen=\"$fullscreen\" \/>";
}


exit;
# end of script

It takes 4 parameters (comma separated):
the url of the movie - i.e. rtsp://128.200.200.1/mymovie.mp4
full screen mode (this can be set to normal, full, double, half or current)
autoplay (true or false)
quitwhendone (true or false)


For example, if my server was 192.168.0.200, the streaming media was "spiderman.mov", I wanted full screen playback, autoplay, and the player to stay open, I would use the following tag to embed the link to my perl script (which I named makeqtlmovie.pl):

<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
height="20" width="120"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab";>
<param name="src" value="watchnow.mov">
<param name="autoplay" value="false">
<param name="controller" value="false">
<param name="target" value="quicktimeplayer">
<param name="href" value="/cgi-bin/makeqtlmovie.pl?rtsp://192.168.0.200/ spiderman.mov,full,true,false"
<embed src="watchnow.mov"
width="120" height="20"
controller="false"
autoplay="false"
target="quicktimeplayer"
href="/cgi-bin/makeqtlmovie.pl?rtsp://192.168.0.200/ spiderman.mov,full,true,false"
pluginspage="http://www.apple.com/quicktime/download/";>


In this case, clients would have to click on the "watchnow" movie to open the qtl file, which launches QT Player in full screen mode. Note that the fullscreen "full" parameter specified in a qtl doesn't work properly with versions before QT 6.1. Using "normal" or "current" is safest.

-George
_______________________________________________
streaming-server-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/streaming-server-users
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.