Add Play Until End of Video Option
parent
602b9b1c4e
commit
a9e8fe70d6
|
|
@ -9178,6 +9178,7 @@ module.exports = function(s,config,lang){
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="btn btn-sm btn-primary" timeline-action="autoGridSizer" title="${lang.autoResizeGrid}"><i class="fa fa-expand"></i></a>
|
<a class="btn btn-sm btn-primary" timeline-action="autoGridSizer" title="${lang.autoResizeGrid}"><i class="fa fa-expand"></i></a>
|
||||||
|
<a class="btn btn-sm btn-primary" timeline-action="playUntilVideoEnd" title="${lang.playUntilVideoEnd}"><i class="fa fa-step-forward"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="btn btn-sm btn-success" timeline-action="downloadAll" title="${lang.Download}"><i class="fa fa-download"></i></a>
|
<a class="btn btn-sm btn-success" timeline-action="downloadAll" title="${lang.Download}"><i class="fa fa-download"></i></a>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
"Monitor Map": "Monitor Map",
|
"Monitor Map": "Monitor Map",
|
||||||
"Geolocation": "Geolocation",
|
"Geolocation": "Geolocation",
|
||||||
"fieldTextGeolocation": "The map coordinates of this camera in the real world. This will plot a point for your camera on the Monitor Map.",
|
"fieldTextGeolocation": "The map coordinates of this camera in the real world. This will plot a point for your camera on the Monitor Map.",
|
||||||
|
"playUntilVideoEnd": "Play until video end",
|
||||||
"Unmute": "Unmute",
|
"Unmute": "Unmute",
|
||||||
"byUser": "by user",
|
"byUser": "by user",
|
||||||
"accountDeleted": "Account Deleted",
|
"accountDeleted": "Account Deleted",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ $(document).ready(function(){
|
||||||
var speedButtons = timeStripControls.find('[timeline-action="speed"]')
|
var speedButtons = timeStripControls.find('[timeline-action="speed"]')
|
||||||
var gridSizeButtons = timeStripControls.find('[timeline-action="gridSize"]')
|
var gridSizeButtons = timeStripControls.find('[timeline-action="gridSize"]')
|
||||||
var autoGridSizerButtons = timeStripControls.find('[timeline-action="autoGridSizer"]')
|
var autoGridSizerButtons = timeStripControls.find('[timeline-action="autoGridSizer"]')
|
||||||
|
var playUntilVideoEndButtons = timeStripControls.find('[timeline-action="playUntilVideoEnd"]')
|
||||||
var currentTimeLabel = timeStripInfo.find('.current-time')
|
var currentTimeLabel = timeStripInfo.find('.current-time')
|
||||||
var timelineActionButtons = timeStripControls.find('[timeline-action]')
|
var timelineActionButtons = timeStripControls.find('[timeline-action]')
|
||||||
var timelineSpeed = 1;
|
var timelineSpeed = 1;
|
||||||
|
|
@ -40,6 +41,7 @@ $(document).ready(function(){
|
||||||
var loadedVideoElsOnCanvas = {}
|
var loadedVideoElsOnCanvas = {}
|
||||||
var loadedVideoElsOnCanvasNextVideoTimeout = {}
|
var loadedVideoElsOnCanvasNextVideoTimeout = {}
|
||||||
var loadedVideoEndingTimeouts = {}
|
var loadedVideoEndingTimeouts = {}
|
||||||
|
var playUntilVideoEnd = false
|
||||||
var isPlaying = false
|
var isPlaying = false
|
||||||
var earliestStart = null
|
var earliestStart = null
|
||||||
var latestEnd = null
|
var latestEnd = null
|
||||||
|
|
@ -375,6 +377,11 @@ $(document).ready(function(){
|
||||||
function getWaitTimeUntilNextVideo(endTimeOfFirstVideo,startTimeOfNextVideo){
|
function getWaitTimeUntilNextVideo(endTimeOfFirstVideo,startTimeOfNextVideo){
|
||||||
return (new Date(startTimeOfNextVideo).getTime() - new Date(endTimeOfFirstVideo).getTime()) / timelineSpeed
|
return (new Date(startTimeOfNextVideo).getTime() - new Date(endTimeOfFirstVideo).getTime()) / timelineSpeed
|
||||||
}
|
}
|
||||||
|
function jumpNextVideoIfEmptyCanvas(){
|
||||||
|
if(isPlaying && hasNoCanvasVideos()){
|
||||||
|
jumpToNextVideo()
|
||||||
|
}
|
||||||
|
}
|
||||||
function clearVideoInCanvas(oldVideo){
|
function clearVideoInCanvas(oldVideo){
|
||||||
var monitorId = oldVideo.mid
|
var monitorId = oldVideo.mid
|
||||||
loadedVideosOnCanvas[monitorId] = null
|
loadedVideosOnCanvas[monitorId] = null
|
||||||
|
|
@ -390,8 +397,10 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
container.empty()
|
container.empty()
|
||||||
timeStripAutoGridResize()
|
timeStripAutoGridResize()
|
||||||
if(isPlaying && hasNoCanvasVideos()){
|
if(playUntilVideoEnd){
|
||||||
jumpToNextVideo()
|
timeStripPlay(true)
|
||||||
|
}else{
|
||||||
|
jumpNextVideoIfEmptyCanvas()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function setVideoInCanvas(newVideo){
|
function setVideoInCanvas(newVideo){
|
||||||
|
|
@ -556,6 +565,7 @@ $(document).ready(function(){
|
||||||
setTimeLabel(newTime);
|
setTimeLabel(newTime);
|
||||||
}, 1000)
|
}, 1000)
|
||||||
setPlayToggleUI(`pause-circle-o`)
|
setPlayToggleUI(`pause-circle-o`)
|
||||||
|
jumpNextVideoIfEmptyCanvas()
|
||||||
}else{
|
}else{
|
||||||
isPlaying = false
|
isPlaying = false
|
||||||
pauseAllVideos()
|
pauseAllVideos()
|
||||||
|
|
@ -647,6 +657,17 @@ $(document).ready(function(){
|
||||||
dashboardOptions('timeStripAutoGridSizer','1')
|
dashboardOptions('timeStripAutoGridSizer','1')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function timeStripPlayUntilVideoEndToggle(){
|
||||||
|
if(playUntilVideoEnd){
|
||||||
|
playUntilVideoEnd = false
|
||||||
|
playUntilVideoEndButtons.removeClass('btn-success')
|
||||||
|
dashboardOptions('timeStripPlayUntilVideoEnd','2')
|
||||||
|
}else{
|
||||||
|
playUntilVideoEnd = true
|
||||||
|
playUntilVideoEndButtons.addClass('btn-success')
|
||||||
|
dashboardOptions('timeStripPlayUntilVideoEnd','1')
|
||||||
|
}
|
||||||
|
}
|
||||||
function timeStripAutoGridResize(){
|
function timeStripAutoGridResize(){
|
||||||
if(!timeStripAutoGridSizer)return;
|
if(!timeStripAutoGridSizer)return;
|
||||||
var numberOfBlocks = getLoadedVideosOnCanvas().length
|
var numberOfBlocks = getLoadedVideosOnCanvas().length
|
||||||
|
|
@ -744,7 +765,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
async function jumpToNextVideo(){
|
async function jumpToNextVideo(){
|
||||||
var video = findNextVideo()
|
var video = findNextVideo()
|
||||||
if(!video)return console.log('No More!')
|
if(!video)timeStripPlay(true);
|
||||||
await jumpToVideo(video)
|
await jumpToVideo(video)
|
||||||
}
|
}
|
||||||
async function jumpToPreviousVideo(){
|
async function jumpToPreviousVideo(){
|
||||||
|
|
@ -811,6 +832,9 @@ $(document).ready(function(){
|
||||||
case'autoGridSizer':
|
case'autoGridSizer':
|
||||||
timeStripAutoGridSizerToggle()
|
timeStripAutoGridSizerToggle()
|
||||||
break;
|
break;
|
||||||
|
case'playUntilVideoEnd':
|
||||||
|
timeStripPlayUntilVideoEndToggle()
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
timeStripObjectSearchInput.change(function(){
|
timeStripObjectSearchInput.change(function(){
|
||||||
|
|
@ -865,4 +889,7 @@ $(document).ready(function(){
|
||||||
if(!currentOptions.timeStripAutoGridSizer || currentOptions.timeStripAutoGridSizer === '1'){
|
if(!currentOptions.timeStripAutoGridSizer || currentOptions.timeStripAutoGridSizer === '1'){
|
||||||
timeStripAutoGridSizerToggle()
|
timeStripAutoGridSizerToggle()
|
||||||
}
|
}
|
||||||
|
if(currentOptions.timeStripPlayUntilVideoEnd === '1'){
|
||||||
|
timeStripPlayUntilVideoEndToggle()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue