CC-2607: Ability to adjust stream bitrate,type,etc from the UI interface

- Modified "Descriptioin" to "Name/Description"
- mount point is not append with extension anymore
- fix on auto generated stream url
- name is used in shoutcast
This commit is contained in:
James 2011-08-19 16:35:23 -04:00
parent f2f599f723
commit a73612afd2
6 changed files with 73 additions and 57 deletions

View file

@ -8,23 +8,39 @@ function showErrorSections() {
}
});
}
function buildStreamUrl(){
$("input:[id$=-host], input:[id$=-port], input:[id$=-mount], select:[id$=-type]").change(function(){
div = $(this).closest("div")
host = div.find("input:[id$=-host]").val()
port = div.find("input:[id$=-port]").val()
mount = div.find("input:[id$=-mount]").val()
type = div.find("select:[id$=-type]").val()
div.find("#stream_url").html("http://"+host+":"+port+"/"+mount+"."+type)
if($(this).attr('id').indexOf('type') != -1){
div.find("#mount_ext").html("."+type)
function rebuildStreamURL(ele){
div = ele.closest("div")
host = div.find("input:[id$=-host]").val()
port = div.find("input:[id$=-port]").val()
mount = div.find("input:[id$=-mount]").val()
streamurl = ""
if(div.find("select:[id$=-output]").val()=="icecast"){
streamurl = "http://"+host
if($.trim(port) != ""){
streamurl += ":"+port
}
})
if($.trim(mount) != ""){
streamurl += "/"+mount
}
}else{
streamurl = "http://"+host+":"+port+"/"
}
div.find("#stream_url").html(streamurl)
}
$(document).ready(function() {
// initial stream url
$("dd[id=outputStreamURL-element]").each(function(){
rebuildStreamURL($(this))
})
$("input:[id$=-host], input:[id$=-port], input:[id$=-mount]").keyup(function(){
rebuildStreamURL($(this))
})
$("select:[id$=-output]").change(function(){
rebuildStreamURL($(this))
})
$('.collapsible-header').click(function() {
$(this).next().toggle('fast');
@ -32,7 +48,17 @@ $(document).ready(function() {
return false;
}).next().hide();
$("select[id$=-output]").change(function(){
if($(this).val() == 'shoutcast'){
$(this).closest("div").find("#outputMountpoint-label").hide()
$(this).closest("div").find("#outputMountpoint-element").hide()
}else{
$(this).closest("div").find("#outputMountpoint-label").show()
$(this).closest("div").find("#outputMountpoint-element").show()
}
})
showErrorSections()
buildStreamUrl()
});