How to make video player show preview image of video before it's played? Instead of a black box / image of a cog
<? $path = $file->originalFilename ;
$info = pathinfo($path);
$infovideo = $file->extension;
?>
<?
$filename = "".$_SERVER['DOCUMENT_ROOT']."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg";
if (file_exists($filename)) {
} else {
$polid = $file->serverId;
$db = Database::getDatabase();
$uploadDetails = $db->getRow('SELECT id, fileServerDomainName FROM file_server WHERE id ='.$polid);
if (is_array($uploadDetails))
{
$ServerId = $uploadDetails['id'];
$fileServerDomainName = $uploadDetails['fileServerDomainName'];
}?>
<?php if ($infovideo == 'mp4' or $infovideo == 'avi' or $infovideo == 'mkv' or $infovideo == 'ts' or $infovideo == 'flv' or $infovideo == 'wmv' ){ ?> <?php
$filename = "".$_SERVER['DOCUMENT_ROOT']."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg";
if (file_exists($filename)) {
$mageffff2 = "" .WEB_ROOT . "/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg";
} else {
$mageffff2 = "".WEB_ROOT."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg";
$fileembedcc = $server;
passthru('ffmpeg -i "'.$fileembedcc.'" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 640x480 -ss 92 "'.$_SERVER['DOCUMENT_ROOT'].'/plugins/mediaconverter/site/screenshots/'.MD5($file->id).'.jpg"');
sleep(1);
$mageffff2 = "".WEB_ROOT."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg";
}
@chmod("".$filename."", 0777);
}
?>
<?php
$id1 = $_GET["id"] ;
$id2 = $_GET["t"] ;
$filename = 'aa.'.$id2''; /* Note: Always use .ext at the end. */
header('Content-type: '.$id2.'');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Accept-Ranges: bytes');
$file = ''.$_SERVER['DOCUMENT_ROOT'].'/files/'.$id1.'';
@readfile($file);
?>
dfdssfsfd3806 said:download page readfile.php upload in server fs1 fs2 etc not local
in _embed.php
Code:<? $path = $file->originalFilename ; $info = pathinfo($path); $infovideo = $file->extension; ?> <? $filename = "".$_SERVER['DOCUMENT_ROOT']."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg"; if (file_exists($filename)) { } else { $polid = $file->serverId; $db = Database::getDatabase(); $uploadDetails = $db->getRow('SELECT id, fileServerDomainName FROM file_server WHERE id ='.$polid); if (is_array($uploadDetails)) { $ServerId = $uploadDetails['id']; $fileServerDomainName = $uploadDetails['fileServerDomainName']; }?> <?php if ($infovideo == 'mp4' or $infovideo == 'avi' or $infovideo == 'mkv' or $infovideo == 'ts' or $infovideo == 'flv' or $infovideo == 'wmv' ){ ?> <?php $filename = "".$_SERVER['DOCUMENT_ROOT']."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg"; if (file_exists($filename)) { $mageffff2 = "" .WEB_ROOT . "/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg"; } else { $mageffff2 = "".WEB_ROOT."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg"; $fileembedcc = $server; passthru('ffmpeg -i "'.$fileembedcc.'" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 640x480 -ss 92 "'.$_SERVER['DOCUMENT_ROOT'].'/plugins/mediaconverter/site/screenshots/'.MD5($file->id).'.jpg"'); sleep(1); $mageffff2 = "".WEB_ROOT."/plugins/mediaconverter/site/screenshots/".MD5($file->id).".jpg"; } @chmod("".$filename."", 0777); } ?>
if(file_exists($filename))
{
}
else
{
/* SNIP */
}
if(!file_exists($filename))
{
}
<?php
$path = $file->originalFilename ;
$info = pathinfo($path);
$infovideo = $file->extension;
$filename = PLUGIN_WEB_ROOT."/mediaconverter/site/screenshots/".md5($file->id).".jpg";
if(!file_exists($filename))
{
$polid = $file->serverId;
$db = Database::getDatabase();
$uploadDetails = $db->getRow('SELECT id, fileServerDomainName FROM file_server WHERE id ='.$polid);
if(is_array($uploadDetails))
{
$ServerId = $uploadDetails['id'];
$fileServerDomainName = $uploadDetails['fileServerDomainName'];
}
if($infovideo == 'mp4' or $infovideo == 'avi' or $infovideo == 'mkv' or $infovideo == 'ts' or $infovideo == 'flv' or $infovideo == 'wmv')
{
$filename = PLUGIN_WEB_ROOT."/mediaconverter/site/screenshots/".md5($file->id).".jpg";
if(file_exists($filename))
{
$mageffff2 = PLUGIN_WEB_ROOT."/mediaconverter/site/screenshots/".md5($file->id).".jpg";
}
else
{
$mageffff2 = PLUGIN_WEB_ROOT."/mediaconverter/site/screenshots/".md5($file->id).".jpg";
$fileembedcc = $server;
passthru('ffmpeg -i "'.$fileembedcc.'" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 640x480 -ss 92 "'.PLUGIN_WEB_ROOT.'/mediaconverter/site/screenshots/'.md5($file->id).'.jpg"');
sleep(1);
$mageffff2 = PLUGIN_WEB_ROOT."/mediaconverter/site/screenshots/".md5($file->id).".jpg";
}
@chmod($filename, 0777);
}
?>
image: '<? echo $mageffff2;?>',