Browse Source

Fixed Upgrade Database script and MediaComposer Control

Evgeny Gagua 3 months ago
parent
commit
96ee92c885
  1. 16
      lib/controller/doSessionOperations.php
  2. 19
      lib/javascript/jsapi_dynamic/argus_main.js
  3. 6
      lib/javascript/jsapi_dynamic/argus_monitoring.js
  4. 206
      lib/javascript/jsapi_dynamic/argus_reports.js
  5. 2
      lib/php/ui/UI_functions.php
  6. 6
      lib/upgrade_database.php
  7. 10
      style/style.css

16
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!';

19
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();

6
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
});

206
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:'<?=$Labels->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: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=2>Compose Videos into one file</td></tr><tr><td colspan=2>&nbsp;</td></tr><tr><td align="center" colspan=2><a class="big_vd_btn" href="javascript:startVideoComposer()">Start Video Composer</a></td></tr><tr><td colspan=2>&nbsp;</td></tr></table></div>'
});
break;
};
case 1:{
rr.add({
border: false,
frame: false,
//layout: 'vbox',
//layoutConfig: {
// align: 'center'
//},
items:[{
html: '<center>Composing Video</center>'
},{
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: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=2>Composed Video from '+sesVideosListRName+' side</td></tr><tr><td align="right">Resolution:</td><td>'+CompositeVideoRightInfo.pic_size+'</td></tr><tr><td align="right">Frame rate:</td><td>'+CompositeVideoRightInfo.fps+'</td></tr><tr><td align="right">Codec:</td><td>'+CompositeVideoRightInfo.codec+'</td></tr><tr><td align="right">Duration:</td><td>'+CompositeVideoRightInfo.duration+'</td></tr><tr><td align="right">File size:</td><td>'+CompositeVideoRightInfo.file_size+'</td></tr><tr><td align="center" colspan=2><a class="big_vd_btn" href="/lib/controller/getComposedVideo.php?SESSION='+rep_selectedEventId+'&SIDE=R">Download</a></td></tr></table></div>'
html: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=2>Compose Videos into one file</td></tr><tr><td colspan=2>&nbsp;</td></tr><tr><td align="center" colspan=2><a class="big_vd_btn" href="javascript:startVideoComposer()">Start Video Composer</a></td></tr><tr><td colspan=2>&nbsp;</td></tr></table></div>'
});
break;
};
if( sesVideosListLExists ){
case 1:{
rr.add({
xtype: 'panel',
frame: false,
border: false,
html: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=2>Composed Video from '+sesVideosListLName+' side</td></tr><tr><td align="right">Resolution:</td><td>'+CompositeVideoLeftInfo.pic_size+'</td></tr><tr><td align="right">Frame rate:</td><td>'+CompositeVideoLeftInfo.fps+'</td></tr><tr><td align="right">Codec:</td><td>'+CompositeVideoLeftInfo.codec+'</td></tr><tr><td align="right">Duration:</td><td>'+CompositeVideoLeftInfo.duration+'</td></tr><tr><td align="right">File size:</td><td>'+CompositeVideoLeftInfo.file_size+'</td></tr><tr><td align="center" colspan=2><a class="big_vd_btn" href="/lib/controller/getComposedVideo.php?SESSION='+rep_selectedEventId+'&SIDE=L">Download</a></td></tr></table></div>'
frame: false,
//layout: 'vbox',
//layoutConfig: {
// align: 'center'
//},
items:[{
html: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center">Composing Video<br/>You may close this window<br/>and<br/>come back later to download video.</td><td width="100px" align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut0_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text-black"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue0">0%</text><text x="50%" y="50%" class="chart-label">DONE</text></g></svg></td></tr></table></div>'
}],
listeners:{
afterrender: function(){
setDonatStatus( 1, 0, 29 );
}
}
});
eventVideosStatusUpdater();
break;
};
case 2:{
if( sesVideosListRExists ){
rr.add({
xtype: 'panel',
frame: false,
border: false,
html: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=3>Composed Video from '+sesVideosListRName+' side</td></tr><tr><td align="right">Duration:</td><td colspan=2>'+CompositeVideoRightInfo.duration+'</td></tr><tr><td align="right">File size:</td><td colspan=2>'+CompositeVideoRightInfo.file_size+'</td></tr><tr><td align="center" colspan=2><div id="r_d_button"></div></td><td align="center"><div id="r_e_button"></div></td></tr><tr><td colspan=3>&nbsp;</td></tr></table></div>'
});
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: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.status == 'ok' ){
CompositeVideoStatus = 0;
CompositeVideoProgress = 0;
CompositeVideoStatusUpdate();
} else {
Ext.Msg.show({
title:'<?=$Labels->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: '<div class="vid_dwc_panel"><table width="100%"><tr><td align="center" colspan=3>Composed Video from '+sesVideosListLName+' side</td></tr><tr><td align="right">Duration:</td><td colspan=2>'+CompositeVideoLeftInfo.duration+'</td></tr><tr><td align="right">File size:</td><td colspan=2>'+CompositeVideoLeftInfo.file_size+'</td></tr><tr><td align="center" colspan=2><div id="l_d_button"></div></td><td align="center"><div id="l_e_button"></div></td></tr><tr><td colspan=3>&nbsp;</td></tr></table></div>'
});
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: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.status == 'ok' ){
CompositeVideoStatus = 0;
CompositeVideoProgress = 0;
CompositeVideoStatusUpdate();
} else {
Ext.Msg.show({
title:'<?=$Labels->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,

2
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;

6
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 =<<<DATA_BOUNDARY
@ -60,7 +60,7 @@ DATA_BOUNDARY;
$UPGRADE = true;
$DATABASE->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`";

10
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;

Loading…
Cancel
Save