LSP tweaks
This commit is contained in:
parent
8f02ac216f
commit
c25cd7f3bf
1 changed files with 140 additions and 118 deletions
258
lsp/pages.js
258
lsp/pages.js
|
@ -494,6 +494,15 @@ function showTab(tabName,streamName) {
|
||||||
).append(
|
).append(
|
||||||
$('<label>').text('Source:').attr('for','settings-streams-'+streamName+'-source').attr('title','The path to the stream, usually "/path/to/filename.dtsc" for files or "push://hostname/streamname" for live streams.').append(
|
$('<label>').text('Source:').attr('for','settings-streams-'+streamName+'-source').attr('title','The path to the stream, usually "/path/to/filename.dtsc" for files or "push://hostname/streamname" for live streams.').append(
|
||||||
$('<input>').attr('type','text').attr('id','settings-streams-'+streamName+'-source').addClass('isSetting').addClass('validate-required').keyup(function(){
|
$('<input>').attr('type','text').attr('id','settings-streams-'+streamName+'-source').addClass('isSetting').addClass('validate-required').keyup(function(){
|
||||||
|
$('#input-validation-info').remove();
|
||||||
|
if (($(this).val().substring(0,7) != 'push://') && ($(this).val().substring(0,1) != '/')) {
|
||||||
|
$(this).parent().append(
|
||||||
|
$('<div>').attr('id','input-validation-info').html(
|
||||||
|
'The stream source should start with "push://" or "/".'
|
||||||
|
).addClass('orange')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if(isLive($(this).val())){
|
if(isLive($(this).val())){
|
||||||
$('.live-only').show();
|
$('.live-only').show();
|
||||||
}
|
}
|
||||||
|
@ -511,6 +520,8 @@ function showTab(tabName,streamName) {
|
||||||
)
|
)
|
||||||
).append(
|
).append(
|
||||||
$('<label>').text('Record to:').addClass('live-only').addClass('LTS-only').attr('for','settings-streams-'+streamName+'-record').attr('title','The path to the file to record to. Leave this field blank if you do not wish to record to file.').append(
|
$('<label>').text('Record to:').addClass('live-only').addClass('LTS-only').attr('for','settings-streams-'+streamName+'-record').attr('title','The path to the file to record to. Leave this field blank if you do not wish to record to file.').append(
|
||||||
|
$('<span>').addClass('unit').text('[.dtsc]')
|
||||||
|
).append(
|
||||||
$('<input>').attr('type','text').attr('id','settings-streams-'+streamName+'-record').addClass('isSetting')
|
$('<input>').attr('type','text').attr('id','settings-streams-'+streamName+'-record').addClass('isSetting')
|
||||||
)
|
)
|
||||||
).append(
|
).append(
|
||||||
|
@ -560,6 +571,14 @@ function showTab(tabName,streamName) {
|
||||||
delete settings.settings.streams[streamName];
|
delete settings.settings.streams[streamName];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
var filename = $('#settings-streams-'+streamName+'-record').val()
|
||||||
|
if (filename != '') {
|
||||||
|
filename = filename.split('.');
|
||||||
|
if (filename[filename.length-1] != 'dtsc') {
|
||||||
|
filename.push('dtsc');
|
||||||
|
}
|
||||||
|
$('#settings-streams-'+streamName+'-record').val(filename.join('.'));
|
||||||
|
}
|
||||||
if (applyInput() === false) { return; }
|
if (applyInput() === false) { return; }
|
||||||
}
|
}
|
||||||
saveAndReload('streams');
|
saveAndReload('streams');
|
||||||
|
@ -589,137 +608,140 @@ function showTab(tabName,streamName) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'streaminfo':
|
case 'streaminfo':
|
||||||
var meta = settings.settings.streams[streamName].meta;
|
getData(function(returnedData){
|
||||||
if (!meta) {
|
settings.settings.streams = returnedData.streams;
|
||||||
$('#page').html('No info available for stream "'+streamName+'".');
|
var meta = settings.settings.streams[streamName].meta;
|
||||||
}
|
if (!meta) {
|
||||||
else {
|
$('#page').html('No info available for stream "'+streamName+'".');
|
||||||
$meta = $('<table>').css('width','auto');
|
}
|
||||||
if (meta.live) {
|
else {
|
||||||
$meta.html(
|
$meta = $('<table>').css('width','auto');
|
||||||
$('<tr>').html(
|
if (meta.live) {
|
||||||
$('<td>').text('Type:')
|
$meta.html(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Type:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text('Live')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (meta.buffer_window) {
|
||||||
|
$meta.append(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Buffer window:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text(meta.buffer_window+' ms')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$meta.html(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Type:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text('Pre-recorded (VoD)')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
for (var index in meta.tracks) {
|
||||||
|
var track = meta.tracks[index];
|
||||||
|
if (track.type == '') { continue; }
|
||||||
|
var $table = $('<table>').html(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Type:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text(capFirstChar(track.type))
|
||||||
|
)
|
||||||
).append(
|
).append(
|
||||||
$('<td>').text('Live')
|
$('<tr>').html(
|
||||||
)
|
$('<td>').text('Codec:')
|
||||||
);
|
).append(
|
||||||
if (meta.buffer_window) {
|
$('<td>').text(track.codec)
|
||||||
|
)
|
||||||
|
).append(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Duration:')
|
||||||
|
).append(
|
||||||
|
$('<td>').html(
|
||||||
|
formatDuration(track.lastms-track.firstms)+'<br>(from '+formatDuration(track.firstms)+' to '+formatDuration(track.lastms)+')'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).append(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Average bitrate:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text(Math.round(track.bps/1024)+' KiB/s')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (track.height) {
|
||||||
|
$table.append(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Size:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text(track.width+'x'+track.height+' px')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (track.fpks) {
|
||||||
|
$table.append(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Framerate:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text(track.fpks/1000+' fps')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (track.channels) {
|
||||||
|
$table.append(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Channels:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text(track.channels)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (track.rate) {
|
||||||
|
$table.append(
|
||||||
|
$('<tr>').html(
|
||||||
|
$('<td>').text('Samplerate:')
|
||||||
|
).append(
|
||||||
|
$('<td>').text(seperateThousands(track.rate,' ')+' Hz')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$meta.append(
|
$meta.append(
|
||||||
$('<tr>').html(
|
$('<tr>').html(
|
||||||
$('<td>').text('Buffer window:')
|
$('<td>').text(capFirstChar(index)+':')
|
||||||
).append(
|
).append(
|
||||||
$('<td>').text(meta.buffer_window+' ms')
|
$('<td>').html(
|
||||||
)
|
$table
|
||||||
);
|
)
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$meta.html(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Type:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text('Pre-recorded (VoD)')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
for (var index in meta.tracks) {
|
|
||||||
var track = meta.tracks[index];
|
|
||||||
if (track.type == '') { continue; }
|
|
||||||
var $table = $('<table>').html(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Type:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text(capFirstChar(track.type))
|
|
||||||
)
|
|
||||||
).append(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Codec:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text(track.codec)
|
|
||||||
)
|
|
||||||
).append(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Duration:')
|
|
||||||
).append(
|
|
||||||
$('<td>').html(
|
|
||||||
formatDuration(track.lastms-track.firstms)+'<br>(from '+formatDuration(track.firstms)+' to '+formatDuration(track.lastms)+')'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
).append(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Average bitrate:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text(Math.round(track.bps/1024)+' KiB/s')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (track.height) {
|
|
||||||
$table.append(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Size:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text(track.width+'x'+track.height+' px')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (track.fpks) {
|
|
||||||
$table.append(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Framerate:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text(track.fpks/1000+' fps')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (track.channels) {
|
|
||||||
$table.append(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Channels:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text(track.channels)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (track.rate) {
|
|
||||||
$table.append(
|
|
||||||
$('<tr>').html(
|
|
||||||
$('<td>').text('Samplerate:')
|
|
||||||
).append(
|
|
||||||
$('<td>').text(seperateThousands(track.rate,' ')+' Hz')
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$meta.append(
|
$('#page').html(
|
||||||
$('<tr>').html(
|
$('<p>').text('Detailed information about stream "'+streamName+'"')
|
||||||
$('<td>').text(capFirstChar(index)+':')
|
).append(
|
||||||
).append(
|
$('<div>').css({'width':'100%','display':'table','table-layout':'fixed','min-height':'300px'}).html(
|
||||||
$('<td>').html(
|
$('<div>').css('display','table-row').html(
|
||||||
$table
|
$('<div>').attr('id','info-stream-meta').css({'display':'table-cell','max-width':'50%','overflow':'auto'}).html(
|
||||||
|
$meta
|
||||||
|
)
|
||||||
|
).append(
|
||||||
|
$('<div>').attr('id','info-stream-statistics').css({'display':'table-cell','text-align':'center','min-height':'200px'})
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$('#page').append(
|
||||||
$('#page').html(
|
$('<button>').text('Back').addClass('escape-to-cancel').click(function(){
|
||||||
$('<p>').text('Detailed information about stream "'+streamName+'"')
|
showTab('streams');
|
||||||
).append(
|
})
|
||||||
$('<div>').css({'width':'100%','display':'table','table-layout':'fixed','min-height':'300px'}).html(
|
|
||||||
$('<div>').css('display','table-row').html(
|
|
||||||
$('<div>').attr('id','info-stream-meta').css({'display':'table-cell','max-width':'50%','overflow':'auto'}).html(
|
|
||||||
$meta
|
|
||||||
)
|
|
||||||
).append(
|
|
||||||
$('<div>').attr('id','info-stream-statistics').css({'display':'table-cell','text-align':'center','min-height':'200px'})
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
},{},0,true);
|
||||||
$('#page').append(
|
|
||||||
$('<button>').text('Back').addClass('escape-to-cancel').click(function(){
|
|
||||||
showTab('streams');
|
|
||||||
})
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
case 'preview':
|
case 'preview':
|
||||||
var httpConnector = false;
|
var httpConnector = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue