Ok. Be warned: I'm not a developer! so my code is probably weird.
It's just a proof of concept. Waiting for your feedback.
--------------------
1. I removed in "view.php" the lines related to flv files
(this code is now into plugins/players/type3.php: I presume that every
video file should be processed first by type3.php ).
Removed lines are commented with a double slash below.
// $flvfile=get_resource_path($ref,"",false,"flv");
if (file_exists("plugins/players/type" . $resource["resource_type"] .
".php"))
{
include "plugins/players/type" . $resource["resource_type"] . ".php";
}
// elseif (file_exists($flvfile) &&
(strpos(strtolower($flvfile),".flv")!==false))
// {
// # Include the Flash player if an FLV file exists for this resource.
// include "flv_play.php";
// }
--------------------
2. I put these two files on the server:
type3.php (video files have type 3 on my installation)
quicktime_play.php
below is the code for each
--------------------
type3.php
<?
$flvfile=get_resource_path($ref,"",false,"flv");
# quicktime compatible extensions
$movfile=get_resource_path($ref,"",false,"mov");
$mp4file=get_resource_path($ref,"",false,"mp4");
$m4vfile=get_resource_path($ref,"",false,"m4v");
$mpgfile=get_resource_path($ref,"",false,"mpg");
$mpegfile=get_resource_path($ref,"",false,"mpeg");
$avifile=get_resource_path($ref,"",false,"avi");
$wmvfile=get_resource_path($ref,"",false,"wmv");
$threegpfile=get_resource_path($ref,"",false,"3gp");
$dvfile=get_resource_path($ref,"",false,"dv");
if (file_exists($flvfile) && (strpos(strtolower($flvfile),".flv")!
==false))
{
# Include the Flash player if an FLV file exists for this resource.
include "flv_play.php";
}
else
{
# Include quicktime player.
include "quicktime_play.php";
}
?>
--------------------
quicktime_play.php
<?
# display a quicktime compatible movie.
if (file_exists($movfile) && (strpos(strtolower($movfile),".mov")!
==false))
{
$ext = "mov";
}
elseif (file_exists($mp4file) && (strpos(strtolower($mp4file),".mp4")!
==false))
{
$ext = "mp4";
}
elseif (file_exists($m4vfile) && (strpos(strtolower($m4vfile),".m4v")!
==false))
{
$ext = "m4v";
}
elseif (file_exists($mpgfile) && (strpos(strtolower($mpgfile),".mpg")!
==false))
{
$ext = "mpg";
}
elseif (file_exists($mpegfile) &&
(strpos(strtolower($mpegfile),".mpeg")!==false))
{
$ext = "mpeg";
}
elseif (file_exists($wmvfile) && (strpos(strtolower($wmvfile),".wmv")!
==false))
{
$ext = "wmv";
}
elseif (file_exists($avifile) && (strpos(strtolower($avifile),".avi")!
==false))
{
$ext = "avi";
}
elseif (file_exists($threegpfile) &&
(strpos(strtolower($threegpfile),".3gp")!==false))
{
$ext = "3gp";
}
elseif (file_exists($dvfile) && (strpos(strtolower($avifile),".dv")!
==false))
{
$ext = "dv";
}
# image created by ffmpeg
$thumb=get_resource_path($ref,"tmp.$ext",false,"jpg");
?>
<object type="video/quicktime" classid="clsid:02BF25D5-8C17-4B23-BC80-
D3488ABDDC6B" codebase="
http://www.apple.com/qtactivex/
qtplugin.cab#version=6,0,2,0" width="480" height="376"
class="Picture">
<param name="width" value="480" />
<param name="height" value="376" />
<param name="autoplay" value="false" />
<param name="controller" value="true" />
<param name="src" value="<?=$thumb?>" />
<param name="href" value="<?=$ref?>.<?=$ext?>" />
<param name="target" value="myself" />
<param name="scale" value="aspect" />
<embed type="video/quicktime" autoplay="false" controller="true"
width="480" height="376" src="<?=$thumb?>" href="<?=$ref?>.<?=$ext?>"
target="myself" scale="aspect" />
</object>
--------------------
As a result, I can now play quicktime compatible movies in the "view"
mode. One click on the poster frame launches the movie.
As you see, supported extensions are: mov, mp4, mpg, mpeg, avi, m4v,
3gp, dv and possibly wmv.
(DV files on a web server is probably not a good idea! your choice ).
Bugs/malfunctions:
- Ffmpeg has an issue with WMV 9 files: It does not output a poster
frame on these files, so there is no image to link to the movie.
- Strangely, movie scaling doesn't work. Maybe trivial but I don't
find how to fix this.
For Mac users: WMV support is added to Quicktime throught the Flip4Mac
Plugin (but you know that if you are really a Mac user....).
Let me know your comments.
---
Guy