diff --git a/lib/controller/doSessionOperations.php b/lib/controller/doSessionOperations.php index be859b1..12b65a8 100644 --- a/lib/controller/doSessionOperations.php +++ b/lib/controller/doSessionOperations.php @@ -98,6 +98,22 @@ $Data['status'] = 'ok'; break; }; + case 4:{ // Delete Composed Session video + $QS = "SELECT * FROM `media_composer_queue` WHERE `session_id`={$OID}"; + $RR = $DATABASE->Query( $QS ); + if( count($RR ) ) { + $QS="DELETE FROM `media_composer_queue` WHERE `session_id`={$OID}"; + $tfn = "./data/composed_videos/{$RR[0]['uuid']}_L.mp4"; + if( file_exists( $tfn ) ) unlink( $tfn ); + $tfn = "./data/composed_videos/{$RR[0]['uuid']}_R.mp4"; + if( file_exists( $tfn ) ) unlink( $tfn ); + $DATABASE->Query( $QS ); + $Data['status'] = 'ok'; + } else { + $Data['msg'] = 'No File Found!'; + }; + break; + }; }; } else { $Data['msg']='Wrong Parameters!'; diff --git a/lib/javascript/jsapi_dynamic/argus_main.js b/lib/javascript/jsapi_dynamic/argus_main.js index 944c5c2..be924ad 100644 --- a/lib/javascript/jsapi_dynamic/argus_main.js +++ b/lib/javascript/jsapi_dynamic/argus_main.js @@ -335,7 +335,7 @@ function showContent( force ){ if( force || updateUserContent() ){ switch( contentView.l[0].v ){ case 0:{ - if( mSesPlay!= null ) { + if( typeof mSesPlay !== 'undefined' ) if( mSesPlay!= null ) { mSesPlay.dispose(); mSesPlay = null; }; @@ -354,7 +354,11 @@ function showContent( force ){ break; }; case 1:{ - if( mSesPlay!= null ) { + if( tlInterval != null ){ + window.clearTimeout( tlInterval ); + tlInterval = null; + }; + if( typeof mSesPlay !== 'undefined' ) if( mSesPlay!= null ) { mSesPlay.dispose(); mSesPlay = null; }; @@ -373,7 +377,7 @@ function showContent( force ){ break; }; case 2:{ - if( mSesPlay!= null ) { + if( typeof mSesPlay !== 'undefined' ) if( mSesPlay!= null ) { mSesPlay.dispose(); mSesPlay = null; }; @@ -418,7 +422,14 @@ function loadHelpTopic( cid, htopic ){ }; Ext.onReady(function(){ - + document.body.style.userSelect = 'none'; + document.body.style.webkitUserSelect = 'none'; + document.addEventListener('selectstart', (e) => { + e.preventDefault(); + }); + document.addEventListener('dragstart', (e) => { + e.preventDefault(); + }); if( 'wakeLock' in navigator ) tryKeepScreenAlive(10); doCheckHeap(); diff --git a/lib/javascript/jsapi_dynamic/argus_monitoring.js b/lib/javascript/jsapi_dynamic/argus_monitoring.js index a3110d0..e44531c 100644 --- a/lib/javascript/jsapi_dynamic/argus_monitoring.js +++ b/lib/javascript/jsapi_dynamic/argus_monitoring.js @@ -1111,8 +1111,10 @@ function fetchStatus(){ manageSideTags('sme_outer', data.expired ); }; }; - }; - tlInterval = window.setTimeout( fetchStatus, 333, selectedSite ); + }; + if( contentView.l[0].v == 0 ){ + tlInterval = window.setTimeout( fetchStatus, 333, selectedSite ); + }; }, failure: failureAJAXFunction }); diff --git a/lib/javascript/jsapi_dynamic/argus_reports.js b/lib/javascript/jsapi_dynamic/argus_reports.js index 54f0a53..08b0398 100644 --- a/lib/javascript/jsapi_dynamic/argus_reports.js +++ b/lib/javascript/jsapi_dynamic/argus_reports.js @@ -682,6 +682,7 @@ var videosListSelModel_ops = { }; var CompositeVideoStatus = 0; +var oldCompositeVideoStatus = -1; var CompositeVideoProgress = 0; var CompositeVideoStatusTO = null; var sesVideosListWindow = null; @@ -691,6 +692,7 @@ var sesVideosListRExists = false; var sesVideosListLExists = false; var CompositeVideoRightInfo = null; var CompositeVideoLeftInfo = null; + function startVideoComposer(){ Ext.Ajax.request({ url: '/lib/controller/doSessionOperations.php', @@ -702,10 +704,12 @@ function startVideoComposer(){ }, success: function( response, opts ){ var data = Ext.decode(response.responseText); - if( data.status == 'ok' ){ + if( data.status == 'ok' ){ CompositeVideoStatus = 1; CompositeVideoProgress = 0; CompositeVideoStatusUpdate(); + setDonatStatus( 1, 0, CompositeVideoProgress ); + CompositeVideoStatusTO = window.setTimeout( eventVideosStatusUpdater, 1000 ); } else { Ext.Msg.show({ title:'GetLabel('_ERROR_MSG_');?>', @@ -718,68 +722,160 @@ function startVideoComposer(){ failure: failureAJAXFunction }); } -function CompositeVideoStatusUpdate(){ - var rr = Ext.getCmp('EvtVidCompDownPanel'); - rr.removeAll(); - switch( CompositeVideoStatus ){ - case 0:{ - rr.add({ - xtype: 'panel', - frame: false, - border: false, - html: '
Compose Videos into one file
 
Start Video Composer
 
' - }); - break; - }; - case 1:{ - rr.add({ - border: false, - frame: false, - //layout: 'vbox', - //layoutConfig: { - // align: 'center' - //}, - items:[{ - html: '
Composing Video
' - },{ - xtype: 'progress', - value: CompositeVideoProgress - }] - }); - //CompositeVideoStatusTO = window.setTimeout( 1000, eventVideosStatusUpdater ); - eventVideosStatusUpdater(); - break; - }; - case 2:{ - if( sesVideosListRExists ){ +function CompositeVideoStatusUpdate(){ + if( oldCompositeVideoStatus != CompositeVideoStatus ){ + var rr = Ext.getCmp('EvtVidCompDownPanel'); + rr.removeAll(); + oldCompositeVideoStatus = CompositeVideoStatus; + switch( CompositeVideoStatus ){ + case 0:{ rr.add({ xtype: 'panel', frame: false, border: false, - html: '
Composed Video from '+sesVideosListRName+' side
Resolution:'+CompositeVideoRightInfo.pic_size+'
Frame rate:'+CompositeVideoRightInfo.fps+'
Codec:'+CompositeVideoRightInfo.codec+'
Duration:'+CompositeVideoRightInfo.duration+'
File size:'+CompositeVideoRightInfo.file_size+'
Download
' + html: '
Compose Videos into one file
 
Start Video Composer
 
' }); + break; }; - if( sesVideosListLExists ){ + case 1:{ rr.add({ - xtype: 'panel', - frame: false, border: false, - html: '
Composed Video from '+sesVideosListLName+' side
Resolution:'+CompositeVideoLeftInfo.pic_size+'
Frame rate:'+CompositeVideoLeftInfo.fps+'
Codec:'+CompositeVideoLeftInfo.codec+'
Duration:'+CompositeVideoLeftInfo.duration+'
File size:'+CompositeVideoLeftInfo.file_size+'
Download
' + frame: false, + //layout: 'vbox', + //layoutConfig: { + // align: 'center' + //}, + items:[{ + html: '
Composing Video
You may close this window
and
come back later to download video.
0%DONE
' + }], + listeners:{ + afterrender: function(){ + setDonatStatus( 1, 0, 29 ); + } + } }); + eventVideosStatusUpdater(); + break; + }; + case 2:{ + if( sesVideosListRExists ){ + rr.add({ + xtype: 'panel', + frame: false, + border: false, + html: '
Composed Video from '+sesVideosListRName+' side
Duration:'+CompositeVideoRightInfo.duration+'
File size:'+CompositeVideoRightInfo.file_size+'
 
' + }); + rr.doLayout(); + new Ext.Button({ + text: 'Download', + width: '80%', + renderTo: 'r_d_button', + handler: function(){ + const l = document.createElement('a'); + l.style.display = 'none'; + l.href = '/lib/controller/getComposedVideo.php?SESSION='+rep_selectedEventId+'&SIDE=L'; + document.body.appendChild(l); + l.click(); + } + }); + new Ext.Button({ + text: 'Delete', + width: '80%', + renderTo: 'r_e_button', + handler: function(){ + Ext.Ajax.request({ + url: '/lib/controller/doSessionOperations.php', + params: { + SESSION: rep_selectedEventId, + OPID: 4, + UID: , + SID: '' + }, + success: function( response, opts ){ + var data = Ext.decode(response.responseText); + if( data.status == 'ok' ){ + CompositeVideoStatus = 0; + CompositeVideoProgress = 0; + CompositeVideoStatusUpdate(); + } else { + Ext.Msg.show({ + title:'GetLabel('_ERROR_MSG_');?>', + msg: data.msg, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + }; + }, + failure: failureAJAXFunction + }); + } + }); + }; + if( sesVideosListLExists ){ + rr.add({ + xtype: 'panel', + frame: false, + border: false, + html: '
Composed Video from '+sesVideosListLName+' side
Duration:'+CompositeVideoLeftInfo.duration+'
File size:'+CompositeVideoLeftInfo.file_size+'
 
' + }); + rr.doLayout(); + new Ext.Button({ + text: 'Download', + width: '80%', + renderTo: 'l_d_button', + handler: function(){ + const l = document.createElement('a'); + l.style.display = 'none'; + l.href = '/lib/controller/getComposedVideo.php?SESSION='+rep_selectedEventId+'&SIDE=L'; + document.body.appendChild(l); + l.click(); + } + }); + new Ext.Button({ + text: 'Delete', + width: '80%', + renderTo: 'l_e_button', + handler: function(){ + Ext.Ajax.request({ + url: '/lib/controller/doSessionOperations.php', + params: { + SESSION: rep_selectedEventId, + OPID: 4, + UID: , + SID: '' + }, + success: function( response, opts ){ + var data = Ext.decode(response.responseText); + if( data.status == 'ok' ){ + CompositeVideoStatus = 0; + CompositeVideoProgress = 0; + CompositeVideoStatusUpdate(); + } else { + Ext.Msg.show({ + title:'GetLabel('_ERROR_MSG_');?>', + msg: data.msg, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + }; + }, + failure: failureAJAXFunction + }); + } + }); + }; + break; }; - break; }; + rr.doLayout(); }; - rr.doLayout(); } function hideEventsVideos(){ - //if( sesVideosListWindow != null ){ - // sesVideosListWindow.hide(); - //} if( CompositeVideoStatusTO!= null ) window.clearTimeout( CompositeVideoStatusTO ); CompositeVideoStatusTO = null; sesVideosListWindow = null; + oldCompositeVideoStatus = -1; } function eventVideosStatusUpdater(){ @@ -792,9 +888,21 @@ function eventVideosStatusUpdater(){ }, success: function( response, opts ){ var data = Ext.decode(response.responseText); - - CompositeVideoStatusUpdate() - CompositeVideoStatusTO = window.setTimeout( 1000, eventVideosStatusUpdater ); + if( data.status == 'ok' ){ + if( data.composed_video_status == 'D'){ + CompositeVideoStatus = 2; + sesVideosListRExists = data.composed_right_video_exists; + sesVideosListLExists = data.composed_left_video_exists; + if( sesVideosListLExists ) CompositeVideoLeftInfo = data.composed_left_info; else CompositeVideoLeftInfo = null; + if( sesVideosListRExists ) CompositeVideoRightInfo = data.composed_right_info; else CompositeVideoRightInfo = null; + CompositeVideoStatusUpdate(); + } else { + CompositeVideoStatusUpdate(); + CompositeVideoProgress = data.composed_video_progress; + setDonatStatus( 1, 0, CompositeVideoProgress ); + CompositeVideoStatusTO = window.setTimeout( eventVideosStatusUpdater, 1000 ); + }; + } } }); } @@ -804,7 +912,7 @@ function showEventsVideos(){ sesVideosListWindow = new Ext.Window({ title: 'Videos', modal: true, - width: 490, + width: 510, height: 560, closeAction: 'close', resizable: false, diff --git a/lib/php/ui/UI_functions.php b/lib/php/ui/UI_functions.php index d391781..abc40e1 100644 --- a/lib/php/ui/UI_functions.php +++ b/lib/php/ui/UI_functions.php @@ -300,6 +300,8 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){ /*overflow: hidden; height: 100%;*/ background: #202020; + -webkit-user-select: none; + user-select: none; } #output { margin-left: 350px; diff --git a/lib/upgrade_database.php b/lib/upgrade_database.php index 001aa76..7b51ddb 100644 --- a/lib/upgrade_database.php +++ b/lib/upgrade_database.php @@ -36,14 +36,14 @@ $UPGRADE = true; $DATABASE->Query( $QS ); }; - $QS = "SHOW TABLES LIKE 'session_composer_queue'" + $QS = "SHOW TABLES LIKE 'session_composer_queue'"; $R = $DATABASE->Query( $QS ); if( count( $R ) ){ $QS = "ALTER TABLE `session_composer_queue` RENAME TO `media_composer_queue`"; $UPGRADE = true; $DATABASE->Query( $QS ); }; - $QS = "SHOW TABLES LIKE 'media_composer_queue1'" + $QS = "SHOW TABLES LIKE 'media_composer_queue'"; $R = $DATABASE->Query( $QS ); if( count( $R ) == 0 ){ $QS =<<Query( $QS ); }; - $QS = "SHOW TABLES LIKE 'media_encoder_queue'" + $QS = "SHOW TABLES LIKE 'media_encoder_queue'"; $R = $DATABASE->Query( $QS ); if( count( $R ) == 0 ){ $QS = "ALTER TABLE `media_queue` RENAME TO `media_encoder_queue`"; diff --git a/style/style.css b/style/style.css index 1ec25b7..e667d6e 100644 --- a/style/style.css +++ b/style/style.css @@ -64,6 +64,16 @@ $fontColor : #fff; transform: translateY(0.25em); } +.chart-text-black { + /*font: 16px/1.4em "Montserrat", Arial, sans-serif;*/ + font: 16px/1.4em "Montserrat", Arial, sans-serif; + fill: #000; + -moz-transform: translateY(0.25em); + -ms-transform: translateY(0.25em); + -webkit-transform: translateY(0.25em); + transform: translateY(0.25em); +} + .chart-number { font-size: 0.5em; line-height: 1;