diff --git a/libs/videos.js b/libs/videos.js index 3731874c..5c6f5891 100644 --- a/libs/videos.js +++ b/libs/videos.js @@ -237,7 +237,7 @@ module.exports = function(s,config,lang){ filename: filename, mid: e.id, ke: e.ke, - time: s.nameToTime(filename), + time: new Date(s.nameToTime(filename)), end: s.formattedTime(new Date,'YYYY-MM-DD HH:mm:ss') },'GRP_'+e.ke); var storageIndex = s.getVideoStorageIndex(e) diff --git a/web/assets/js/bs5.videos.js b/web/assets/js/bs5.videos.js index af9d3740..cf7344fe 100644 --- a/web/assets/js/bs5.videos.js +++ b/web/assets/js/bs5.videos.js @@ -75,14 +75,14 @@ function createVideoRow(row,classOverride){ $.each(objectsFound,function(tag,count){ eventMatrixHtml += ` ${tag} - ${count} + ${count} ` }) eventMatrixHtml += `` } var videoEndpoint = getLocation() + '/' + $user.auth_token + '/videos/' + $user.ke + '/' + row.mid + '/' + row.filename return ` -
+
@@ -181,6 +181,25 @@ function getEvents(options,callback){ callback(eventData) }) } +onWebSocketEvent(function(d){ + switch(d.f){ + case'video_delete': + console.log(d) + $('[file="'+d.filename+'"][mid="'+d.mid+'"]:not(.modal)').remove(); + $('[data-file="'+d.filename+'"][data-mid="'+d.mid+'"]:not(.modal)').remove(); + $('[data-time-formed="'+(new Date(d.time))+'"][data-mid="'+d.mid+'"]:not(.modal)').remove(); + // if($.powerVideoWindow.currentDataObject&&$.powerVideoWindow.currentDataObject[d.filename]){ + // delete($.timelapse.currentVideos[$.powerVideoWindow.currentDataObject[d.filename].position]) + // $.powerVideoWindow.drawTimeline(false) + // } + // if($.timelapse.currentVideos&&$.timelapse.currentVideos[d.filename]){ + // delete($.timelapse.currentVideosArray.videos[$.timelapse.currentVideos[d.filename].position]) + // $.timelapse.drawTimeline(false) + // } + // if($.vidview.loadedVideos && $.vidview.loadedVideos[d.filename])delete($.vidview.loadedVideos[d.filename]) + break; + } +}) $(document).ready(function(){ $('body') .on('click','.open-video',function(){