zoneminder/web/skins/classic/views/js/video.js

34 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-05-19 01:50:56 +08:00
function deleteVideo( index ) {
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&deleteIndex='+index );
}
2017-05-19 01:50:56 +08:00
function downloadVideo( index ) {
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&downloadIndex='+index );
}
var generateVideoTimer = null;
2017-05-19 01:50:56 +08:00
function generateVideoProgress() {
var tickerText = $('videoProgressTicker').get('text');
if ( tickerText.length < 1 || tickerText.length > 4 )
$('videoProgressTicker').set( 'text', '.' );
else
$('videoProgressTicker').appendText( '.' );
}
2017-05-19 01:50:56 +08:00
function generateVideoResponse( respObj, respText ) {
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&generated='+((respObj.result=='Ok')?1:0) );
}
2017-05-19 01:50:56 +08:00
function generateVideo( form ) {
var parms = 'view=request&request=event&action=video';
parms += '&'+$(form).toQueryString();
var query = new Request.JSON( { url: thisUrl, method: 'post', data: parms, onSuccess: generateVideoResponse } );
query.send();
$('videoProgress').removeClass( 'hidden' );
$('videoProgress').setProperty( 'class', 'warnText' );
$('videoProgressText').set( 'text', videoGenProgressString );
generateVideoProgress();
generateVideoTimer = generateVideoProgress.periodical( 500 );
}