Merge pull request #1125 from liucougar/smart_video_or_image
better way of detecting showing image or video in timeline and event view
This commit is contained in:
commit
f5fedde139
|
@ -117,6 +117,7 @@ $statusData = array(
|
||||||
"Height" => true,
|
"Height" => true,
|
||||||
"Length" => true,
|
"Length" => true,
|
||||||
"Frames" => true,
|
"Frames" => true,
|
||||||
|
"DefaultVideo" => true,
|
||||||
"AlarmFrames" => true,
|
"AlarmFrames" => true,
|
||||||
"TotScore" => true,
|
"TotScore" => true,
|
||||||
"AvgScore" => true,
|
"AvgScore" => true,
|
||||||
|
|
|
@ -138,7 +138,7 @@ if ( $event['SaveJPEGs'] & 3 )
|
||||||
</div>
|
</div>
|
||||||
<div id="eventVideo" class="">
|
<div id="eventVideo" class="">
|
||||||
<?php
|
<?php
|
||||||
if ( $event['VideoWriter'] )
|
if ( $event['DefaultVideo'] )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
|
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
|
||||||
|
|
|
@ -111,8 +111,8 @@ function previewEvent( eventId, frameId )
|
||||||
{
|
{
|
||||||
showEventDetail( events[eventId]['frames'][frameId]['html'] );
|
showEventDetail( events[eventId]['frames'][frameId]['html'] );
|
||||||
var imagePath = events[eventId].frames[frameId].Image.imagePath;
|
var imagePath = events[eventId].frames[frameId].Image.imagePath;
|
||||||
var showVideo = parseInt(monitors[events[eventId].MonitorId].VideoWriter);
|
var videoName = events[eventId].DefaultVideo;
|
||||||
loadEventImage( imagePath, eventId, frameId, events[eventId].Width, events[eventId].Height, events[eventId].Frames/events[eventId].Length, showVideo);
|
loadEventImage( imagePath, eventId, frameId, events[eventId].Width, events[eventId].Height, events[eventId].Frames/events[eventId].Length, videoName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,15 +120,15 @@ function previewEvent( eventId, frameId )
|
||||||
requestFrameData( eventId, frameId );
|
requestFrameData( eventId, frameId );
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadEventImage( imagePath, eid, fid, width, height, fps, showVideo )
|
function loadEventImage( imagePath, eid, fid, width, height, fps, videoName )
|
||||||
{
|
{
|
||||||
var vid= $('preview');
|
var vid= $('preview');
|
||||||
var imageSrc = $('imageSrc');
|
var imageSrc = $('imageSrc');
|
||||||
if(showVideo)
|
if(videoName)
|
||||||
{
|
{
|
||||||
vid.show();
|
vid.show();
|
||||||
imageSrc.hide();
|
imageSrc.hide();
|
||||||
var newsource=imagePrefix+imagePath.slice(0,imagePath.lastIndexOf('/'))+"/event.mp4";
|
var newsource=imagePrefix+imagePath.slice(0,imagePath.lastIndexOf('/'))+"/"+videoName;
|
||||||
//console.log(newsource);
|
//console.log(newsource);
|
||||||
//console.log(sources[0].src.slice(-newsource.length));
|
//console.log(sources[0].src.slice(-newsource.length));
|
||||||
if(newsource!=vid.currentSrc.slice(-newsource.length) || vid.readyState==0)
|
if(newsource!=vid.currentSrc.slice(-newsource.length) || vid.readyState==0)
|
||||||
|
|
Loading…
Reference in New Issue