remove non-existent id preview

This commit is contained in:
Andrew Bauer 2020-12-21 15:59:05 -06:00
parent d080109f4b
commit cbe04674c5
1 changed files with 6 additions and 32 deletions

View File

@ -127,39 +127,13 @@ function previewEvent(slot) {
} }
function loadEventImage( imagePath, eid, fid, width, height, fps, videoName, duration, startTime, Monitor ) { function loadEventImage( imagePath, eid, fid, width, height, fps, videoName, duration, startTime, Monitor ) {
var vid = $('preview');
var imageSrc = $j('#imageSrc'); var imageSrc = $j('#imageSrc');
if ( videoName && vid ) {
vid.show(); imageSrc.show();
imageSrc.hide(); imageSrc.attr('src', imagePath);
var newsource=imagePath.slice(0, imagePath.lastIndexOf('/'))+'/'+videoName; imageSrc.data('event-id', eid);
//console.log(newsource); imageSrc.data('frame-id', fid);
//console.log(sources[0].src.slice(-newsource.length)); imageSrc.click(window['showEvent'].bind(imageSrc, imageSrc));
if ( newsource != vid.currentSrc.slice(-newsource.length) || vid.readyState == 0 ) {
//console.log("loading new");
//it is possible to set a long source list here will that be unworkable?
var sources = vid.getElementsByTagName('source');
sources[0].src = newsource;
var tracks = vid.getElementsByTagName('track');
if (tracks.length) {
tracks[0].parentNode.removeChild(tracks[0]);
}
vid.load();
addVideoTimingTrack(vid, Monitor.LabelFormat, Monitor.Name, duration, startTime);
vid.currentTime = fid/fps;
} else {
if ( ! vid.seeking ) {
vid.currentTime=fid/fps;
}
}
} else {
if ( vid ) vid.hide();
imageSrc.show();
imageSrc.attr('src', imagePath);
imageSrc.data('event-id', eid);
imageSrc.data('frame-id', fid);
imageSrc.click(window['showEvent'].bind(imageSrc, imageSrc));
}
var eventData = $j('#eventData'); var eventData = $j('#eventData');
eventData.off('click'); eventData.off('click');