diff --git a/share/Makefile.am b/share/Makefile.am index bd8d7c0e0c..af3fcf87fc 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -248,118 +248,122 @@ EXTRA_DIST += \ lua/sd/metachannels.lua DIST_http_lua = \ - lua/http/.hosts \ - lua/http/css/main.css \ - lua/http/css/ui-lightness/jquery-ui-1.8.13.custom.css \ - lua/http/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png \ - lua/http/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png \ - lua/http/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png \ - lua/http/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png \ - lua/http/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png \ - lua/http/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png \ - lua/http/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png \ - lua/http/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png \ - lua/http/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png \ - lua/http/css/ui-lightness/images/ui-icons_222222_256x240.png \ - lua/http/css/ui-lightness/images/ui-icons_228ef1_256x240.png \ - lua/http/css/ui-lightness/images/ui-icons_ef8c08_256x240.png \ - lua/http/css/ui-lightness/images/ui-icons_ffd27a_256x240.png \ - lua/http/css/ui-lightness/images/ui-icons_ffffff_256x240.png \ - lua/http/custom.lua \ - lua/http/dialogs/.hosts \ - lua/http/dialogs/browse \ - lua/http/dialogs/browse_window.html \ + lua/http/view.html \ + lua/http/mobile.html \ lua/http/dialogs/create_stream.html \ - lua/http/dialogs/footer \ - lua/http/dialogs/input \ - lua/http/dialogs/main \ - lua/http/dialogs/mosaic \ + lua/http/dialogs/equalizer_window.html \ lua/http/dialogs/mosaic_window.html \ - lua/http/dialogs/offset_window.html \ - lua/http/dialogs/playlist \ - lua/http/dialogs/sout \ + lua/http/dialogs/batch_window.html \ + lua/http/dialogs/error_window.html \ + lua/http/dialogs/browse_window.html \ + lua/http/dialogs/.hosts \ lua/http/dialogs/stream_window.html \ - lua/http/dialogs/vlm \ - lua/http/favicon.ico \ + lua/http/dialogs/offset_window.html \ + lua/http/dialogs/stream_config_window.html \ + lua/http/custom.lua \ lua/http/flash.html \ + lua/http/vlm.html \ + lua/http/images/loop.png \ + lua/http/images/button_pause-48.png \ + lua/http/images/speaker-32.png \ + lua/http/images/fullscreen.png \ + lua/http/images/vlc-48.png \ + lua/http/images/prev.png \ + lua/http/images/play.png \ lua/http/images/Audio-48.png \ + lua/http/images/empty.png \ + lua/http/images/minus.png \ + lua/http/images/slider_right.png \ + lua/http/images/slider_point.png \ + lua/http/images/pause.png \ + lua/http/images/speaker_mute.png \ + lua/http/images/delete_small.png \ + lua/http/images/snapshot.png \ + lua/http/images/Folder-48.png \ + lua/http/images/info.png \ + lua/http/images/refresh.png \ + lua/http/images/sout.png \ + lua/http/images/button_stop-48.png \ + lua/http/images/button_help-48.png \ + lua/http/images/button-equalizer-48.png \ + lua/http/images/button_ffw-48.png \ + lua/http/images/sort.png \ + lua/http/images/button_play-48.png \ + lua/http/images/white_cross_small.png \ + lua/http/images/button_full-48.png \ + lua/http/images/shuffle.png \ + lua/http/images/Other-48.png \ + lua/http/images/button_repeat-48.png \ + lua/http/images/repeat.png \ + lua/http/images/slow.png \ + lua/http/images/slider_left.png \ + lua/http/images/help.png \ + lua/http/images/stop.png \ + lua/http/images/sd.png \ + lua/http/images/speaker.png \ + lua/http/images/button_first-48.png \ + lua/http/images/button_stream-48.png \ + lua/http/images/button_rew-48.png \ + lua/http/images/button_rec-48.png \ + lua/http/images/delete.png \ lua/http/images/Back-48.png \ lua/http/images/button_eject-48.png \ - lua/http/images/button_ffw-48.png \ - lua/http/images/button_first-48.png \ - lua/http/images/button_full-48.png \ - lua/http/images/button_help-48.png \ - lua/http/images/button_last-48.png \ - lua/http/images/button_pause-48.png \ - lua/http/images/button_play-48.png \ - lua/http/images/button_rec-48.png \ - lua/http/images/button_repeat-48.png \ - lua/http/images/button_rew-48.png \ - lua/http/images/button_stop-48.png \ - lua/http/images/button_stream-48.png \ - lua/http/images/delete.png \ - lua/http/images/delete_small.png \ - lua/http/images/eject.png \ - lua/http/images/empty.png \ - lua/http/images/Folder-48.png \ - lua/http/images/fullscreen.png \ - lua/http/images/help.png \ - lua/http/images/info.png \ - lua/http/images/loop.png \ - lua/http/images/minus.png \ - lua/http/images/next.png \ - lua/http/images/Other-48.png \ - lua/http/images/pause.png \ - lua/http/images/play.png \ - lua/http/images/playlist.png \ - lua/http/images/playlist_small.png \ - lua/http/images/plus.png \ - lua/http/images/prev.png \ - lua/http/images/refresh.png \ - lua/http/images/repeat.png \ - lua/http/images/reset.png \ - lua/http/images/sd.png \ - lua/http/images/shuffle.png \ - lua/http/images/slider_bar.png \ - lua/http/images/slider_left.png \ - lua/http/images/slider_point.png \ - lua/http/images/slider_right.png \ - lua/http/images/snapshot.png \ - lua/http/images/slow.png \ - lua/http/images/sort.png \ - lua/http/images/sout.png \ - lua/http/images/speaker-32.png \ - lua/http/images/speaker.png \ - lua/http/images/speaker_mute.png \ - lua/http/images/stop.png \ lua/http/images/Video-48.png \ - lua/http/images/vlc16x16.png \ - lua/http/images/volume_down.png \ + lua/http/images/playlist_small.png \ + lua/http/images/eject.png \ + lua/http/images/playlist.png \ lua/http/images/volume_up.png \ + lua/http/images/next.png \ + lua/http/images/button_last-48.png \ + lua/http/images/volume_down.png \ + lua/http/images/slider_bar.png \ + lua/http/images/vlc16x16.png \ + lua/http/images/plus.png \ lua/http/images/white.png \ - lua/http/images/white_cross_small.png \ - lua/http/index.html \ - lua/http/js/common.js \ - lua/http/js/controlers.js \ - lua/http/js/functions.js \ - lua/http/js/jquery-1.5.1.min.js \ - lua/http/js/jquery.jstree.js \ - lua/http/js/jquery-ui-1.8.13.custom.min.js \ - lua/http/js/mosaic.js \ - lua/http/js/vlm.js \ + lua/http/images/reset.png \ + lua/http/mobile_equalizer.html \ + lua/http/vlm_export.html \ + lua/http/mobile_browse.html \ lua/http/mosaic.html \ - lua/http/requests/browse.xml \ - lua/http/requests/equalizer.xml \ + lua/http/favicon.ico \ + lua/http/mobile_view.html \ + lua/http/.hosts \ lua/http/requests/playlist.xml \ + lua/http/requests/README.txt \ + lua/http/requests/playlist_jstree.xml \ + lua/http/requests/equalizer.xml \ + lua/http/requests/browse.xml \ + lua/http/requests/vlm_cmd.xml \ lua/http/requests/status.xml \ lua/http/requests/vlm.xml \ - lua/http/requests/vlm_cmd.xml \ - lua/http/requests/README.txt \ - lua/http/style.css \ + lua/http/index.html \ + lua/http/css/ui-lightness/jquery-ui-1.8.13.custom.css \ + lua/http/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png \ + lua/http/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png \ + lua/http/css/ui-lightness/images/ui-icons_ffffff_256x240.png \ + lua/http/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png \ + lua/http/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png \ + lua/http/css/ui-lightness/images/ui-icons_222222_256x240.png \ + lua/http/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png \ + lua/http/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png \ + lua/http/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png \ + lua/http/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png \ + lua/http/css/ui-lightness/images/ui-icons_ffd27a_256x240.png \ + lua/http/css/ui-lightness/images/ui-icons_228ef1_256x240.png \ + lua/http/css/ui-lightness/images/ui-icons_ef8c08_256x240.png \ + lua/http/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png \ + lua/http/css/main.css \ lua/http/iehacks.css \ - lua/http/view.html \ - lua/http/vlm.html \ - lua/http/vlm_export.html + lua/http/js/jquery-1.5.1.min.js \ + lua/http/js/functions.js \ + lua/http/js/vlm.js \ + lua/http/js/ui.js \ + lua/http/js/common.js \ + lua/http/js/jquery.jstree.js \ + lua/http/js/controlers.js \ + lua/http/js/jquery-ui-1.8.13.custom.min.js \ + lua/http/js/mosaic.js \ + lua/http/style.css DIST_maemo = \ maemo/vlc_intf.rc \ diff --git a/share/lua/http/css/main.css b/share/lua/http/css/main.css index 57c19d3554..9dd2b8324b 100644 --- a/share/lua/http/css/main.css +++ b/share/lua/http/css/main.css @@ -90,6 +90,9 @@ body{ #buttonSout{ background-image: url("../images/button_stream-48.png") ; } +#buttonEQ{ + background-image: url("../images/button-equalizer-48.png") ; +} #window_browse ol{ list-style-type: none; } @@ -114,6 +117,18 @@ body{ #window_create_stream table tr td{ font-size: 11px; } + +#window_equalizer div div{ + text-align: center; + font-size: 11px; + padding: 0px; +} +.eqBand{ + margin-bottom: 10px; + margin-top: 10px; + height: 400px; + font-size: 1.5em; +} .footer{ text-align: center; font-size: 11px; diff --git a/share/lua/http/dialogs/batch_window.html b/share/lua/http/dialogs/batch_window.html new file mode 100644 index 0000000000..c6aa396064 --- /dev/null +++ b/share/lua/http/dialogs/batch_window.html @@ -0,0 +1,29 @@ + +
+ +
\ No newline at end of file diff --git a/share/lua/http/dialogs/browse_window.html b/share/lua/http/dialogs/browse_window.html index d578a0e296..38a24a1399 100644 --- a/share/lua/http/dialogs/browse_window.html +++ b/share/lua/http/dialogs/browse_window.html @@ -1,20 +1,11 @@ +
+
+
Preamp: 0dB
+
+
+
+
+
\ No newline at end of file diff --git a/share/lua/http/dialogs/error_window.html b/share/lua/http/dialogs/error_window.html new file mode 100644 index 0000000000..22639ace92 --- /dev/null +++ b/share/lua/http/dialogs/error_window.html @@ -0,0 +1,19 @@ + +
+
+
+
\ No newline at end of file diff --git a/share/lua/http/dialogs/mosaic_window.html b/share/lua/http/dialogs/mosaic_window.html index a55c613ad0..c721d7cc06 100644 --- a/share/lua/http/dialogs/mosaic_window.html +++ b/share/lua/http/dialogs/mosaic_window.html @@ -7,7 +7,6 @@ minWidth: 800, minHeight: 500, modal: true, - position: ['left','top'], buttons: { "Create": function() { $(this).dialog("close"); diff --git a/share/lua/http/dialogs/offset_window.html b/share/lua/http/dialogs/offset_window.html index bf6679491b..1b5d375d74 100644 --- a/share/lua/http/dialogs/offset_window.html +++ b/share/lua/http/dialogs/offset_window.html @@ -3,7 +3,6 @@ $('#window_offset').dialog({ autoOpen: false, minWidth: 400, - position: ['left','top'], buttons:{ "Close":function(){ $(this).dialog("close"); diff --git a/share/lua/http/dialogs/stream_config_window.html b/share/lua/http/dialogs/stream_config_window.html new file mode 100644 index 0000000000..b35f218659 --- /dev/null +++ b/share/lua/http/dialogs/stream_config_window.html @@ -0,0 +1,40 @@ + +
+ + + + + + + + + + + + + + + + + +
Protocol
Host
Port
File
+
\ No newline at end of file diff --git a/share/lua/http/dialogs/stream_window.html b/share/lua/http/dialogs/stream_window.html index a9fe277ce5..288e2f729c 100644 --- a/share/lua/http/dialogs/stream_window.html +++ b/share/lua/http/dialogs/stream_window.html @@ -11,7 +11,6 @@ autoOpen: false, minWidth: 600, minHeight: 430, - position: ['left','top'], buttons:{ "Close":function(){ $(this).dialog("close"); @@ -21,7 +20,6 @@ $('#window_stream_config').dialog({ autoOpen: false, width:400, - position: ['left','top'], modal: true, buttons:{ "Okay":function(){ @@ -44,6 +42,10 @@ $('#button_create_mosaic').click(function(){ $('#window_mosaic').dialog('open'); return false; + }); + $('#button_refresh_streams').click(function(){ + updateStreams(); + return false; }) $('#stream_host').val(stream_server); }); @@ -67,6 +69,7 @@
+
diff --git a/share/lua/http/images/button-equalizer-48.png b/share/lua/http/images/button-equalizer-48.png new file mode 100644 index 0000000000..1574cd687c Binary files /dev/null and b/share/lua/http/images/button-equalizer-48.png differ diff --git a/share/lua/http/images/vlc-48.png b/share/lua/http/images/vlc-48.png new file mode 100644 index 0000000000..327b53894c Binary files /dev/null and b/share/lua/http/images/vlc-48.png differ diff --git a/share/lua/http/index.html b/share/lua/http/index.html index df06a0e10d..0629831a63 100644 --- a/share/lua/http/index.html +++ b/share/lua/http/index.html @@ -1,59 +1,52 @@ + - VLC media player - Web Interface + + + - + - -
@@ -244,6 +209,8 @@
+
+
@@ -330,8 +297,7 @@ - \ No newline at end of file diff --git a/share/lua/http/js/common.js b/share/lua/http/js/common.js index f692ba7128..9982b23449 100644 --- a/share/lua/http/js/common.js +++ b/share/lua/http/js/common.js @@ -1,5 +1,8 @@ var intv = 0; var ccmd = ""; +var video_types = new Array('avi','mp4','wmv','mov','swf','vob','mkv','mpg'); +var audio_types = new Array('mp3','wav'); +var stream_server = window.location.hostname; function format_time( s ){ var hours = Math.floor(s/3600); var minutes = Math.floor((s/60)%60); @@ -36,3 +39,23 @@ function setIntv(){ } } } +function convertHz(value){ + if(value>=1000){ + return Math.round(value/1000,2)+'kHz'; + }else{ + return Math.round(value,2)+'Hz'; + } +} +function isMobile(){ + var a = navigator.userAgent||navigator.vendor||window.opera; + if(/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))){ + return true; + } + return false; +} +function createElementLi(name,type,dir,ext){ + var icon = type=="dir" && name=='..' ? 'Back-48.png' : (type=='dir' ? "Folder-48.png" : ($.inArray(ext,video_types)!=-1 ? "Video-48.png" : ($.inArray(ext,audio_types)!=-1 ? "Audio-48.png" : "Other-48.png"))); + var open = type=="dir" ? "opendir='"+dir+"'" : (type=="file" ? "openfile='"+dir+"'" : "opendev='"+dir+"'"); + var str = "
  • "+name+"
    "+name+"
  • "; + return str; +} \ No newline at end of file diff --git a/share/lua/http/js/controlers.js b/share/lua/http/js/controlers.js index 6aa44d135c..6a7dd78ac8 100644 --- a/share/lua/http/js/controlers.js +++ b/share/lua/http/js/controlers.js @@ -21,6 +21,7 @@ function updateStatus(){ $('#currentSubtitleDelay').append(Math.round($('subtitledelay',data).text()*100)/100+'s'); $('#seekSlider').attr('totalLength',$('length',data).text()); $('#buttonPlay').attr('state',$('state',data).text()); + $('#buttonPlay').attr('mrl',$('[name="filename"]',data).text()); if($('state',data).text()=='playing'){ $('#buttonPlay').css({ 'background-image':'url("images/button_pause-48.png")' @@ -60,29 +61,64 @@ function updateStatus(){ 'display':'block' }); }else if($('[name="artwork_url"]',data).text()==""){ - $('#albumArt').css({ - 'visibility':'hidden', - 'display':'none' - }); + $('#albumArt').attr('src','images/vlc-48.png'); } - setTimeout( updateStatus, 1000 ); + if(pollStatus){ + setTimeout( updateStatus, 1000 ); + } + } + $('band',data).each(function(){ + var id = $(this).attr('id'); + var freq = convertHz($(this).attr('freqency')); + var value = $(this).text() ? $(this).text() : 0; + if(!$('#eq_container'+id).length){ + $('#window_equalizer').append('
    '+value+'dB
    '+freq+'
    '); + $('#eq'+id).slider({ + min: -20, + max: 20, + step: 0.1, + range: "min", + value: value, + animate: true, + orientation: "vertical", + stop: function(event,ui){ + $('#'+$(this).attr('id')+'_txt').empty().append(ui.value+'dB'); + sendCommad({ + command:'equalizer', + val: ui.value, + band: $(this).attr('id').substr(2) + }) + }, + slide: function(event,ui){ + $('#'+$(this).attr('id')+'_txt').empty().append(ui.value+'dB'); + } + }); + }else{ + $('#eq'+id).slider({value:value}); + $('#eq'+id+'_txt').empty().append(Math.round(value*100)/100+'dB'); + } + }); + $('#preamp').slider('value',$('preamp',data).text()); + $('#preamp_txt').empty().append(Math.round($('preamp',data).text()*100)/100+'dB'); }, error: function(jqXHR,status,error){ setTimeout( updateStatus, 500 ); } }); } - function updatePlayList(){ $('#libraryTree').jstree('refresh',-1); } -function sendCommand(params){ +function sendCommand(params,append){ if(current_que=='stream'){ $.ajax({ url: 'requests/status.xml', data: params, success:function(data,status,jqXHR){ + if(append!=undefined){ + eval(append); + } updateStatus(); updatePlayList(); } @@ -91,20 +127,26 @@ function sendCommand(params){ if(params.plreload===false){ $.ajax({ url: 'requests/status.xml', - data: params + data: params, + success:function(data,status,jqXHR){ + if(append!=undefined){ + eval(append); + } + } }); }else{ $.ajax({ url: 'requests/status.xml', data: params, success:function(data,status,jqXHR){ + if(append!=undefined){ + eval(append); + } updatePlayList(); } }); - } - + } } - } function browse(dir){ dir = dir==undefined ? '~' : dir; @@ -112,6 +154,7 @@ function browse(dir){ url: 'requests/browse.xml', data:'dir='+encodeURIComponent(dir), success: function(data,status,jqXHR){ + var tgt = browse_target.indexOf('__')==-1 ? browse_target : browse_target.substr(0,browse_target.indexOf('__')); $('#browse_elements').empty(); $('element',data).each(function(){ if($(this).attr('type')=='dir' || $.inArray($(this).attr('name').substr(-3),video_types)!=-1 || $.inArray($(this).attr('name').substr(-3),audio_types)!=-1){ @@ -122,7 +165,6 @@ function browse(dir){ browse($(this).attr('opendir')); }); $('[openfile]').dblclick(function(){ - var tgt = browse_target.indexOf('__')==-1 ? browse_target : browse_target.substr(0,browse_target.indexOf('__')); switch(tgt){ case '#stream_input': $(browse_target).val($(this).attr('openfile')); @@ -136,14 +178,39 @@ function browse(dir){ 'float' : 'left' }); break; + case '#mobile': + break; default: sendCommand('command=in_play&input=file://'+encodeURIComponent($(this).attr('openfile'))); break; } $('#window_browse').dialog('close'); }); - $('[selectable]').selectable(); - + $('[opendir]').click(function(){ + switch(tgt){ + case '#mobile': + browse($(this).attr('opendir')); + break; + default: + break; + } + }); + $('[openfile]').click(function(){ + switch(tgt){ + case '#mobile': + sendCommand('command=in_play&input=file://'+encodeURIComponent($(this).attr('openfile')),"window.location='mobile.html'"); + break; + default: + break; + } + }); + switch(tgt){ + case '#mobile': + break; + default: + $('[selectable]').selectable(); + break; + } }, error: function(jqXHR,status,error){ setTimeout('browse("'+dir+'")',1041); @@ -256,47 +323,113 @@ function updateStreams(){ } setTimeout( updateStreams, 1000 ); } - } }); } -function sendVLMCmd(command){ +function updateEQ(){ + $.ajax({ + url: 'requests/equalizer.xml', + success: function(data,status,jqXHR){ + $('band',data).each(function(){ + var id = $(this).attr('id'); + var freq = convertHz($(this).attr('freqency')); + var value = $(this).text() ? $(this).text() : 0; + if(!$('#eq_container'+id).length){ + $('#window_equalizer').append('
    '+value+'dB
    '+freq+'
    '); + $('#eq'+id).slider({ + min: -20, + max: 20, + step: 0.1, + range: "min", + value: value, + animate: true, + orientation: "vertical", + stop: function(event,ui){ + $('#'+$(this).attr('id')+'_txt').empty().append(ui.value+'dB'); + sendEQCmd({ + command:'equalizer', + val: ui.value, + band: $(this).attr('id').substr(2) + }) + }, + slide: function(event,ui){ + $('#'+$(this).attr('id')+'_txt').empty().append(ui.value+'dB'); + } + }); + }else{ + $('#eq'+id).slider({value:value}); + $('#eq'+id+'_txt').empty().append(Math.round(value*100)/100+'dB'); + } + }); + $('#preamp').slider('value',$('preamp',data).text()); + $('#preamp_txt').empty().append(Math.round($('preamp',data).text()*100)/100+'dB'); + } + }) +} +function sendVLMCmd(command,append){ var commands = command.split(';'); if(commands.length>1){ - sendBatchVLMCmd(command); + sendBatchVLMCmd(command,append); }else{ if(current_que=='main'){ $.ajax({ url: 'requests/vlm_cmd.xml', data: 'command='+encodeURIComponent(command), success: function(data,status,jqXHR){ + if($('error',data).text()){ + $('#error_container').append('
    '+$('error',data).text()+'
    '); + $('#window_error').dialog('open'); + } + if(append!=undefined){ + eval(append); + } updateStreams(); } }); }else{ $.ajax({ url: 'requests/vlm_cmd.xml', - data: 'command='+encodeURIComponent(command) + data: 'command='+encodeURIComponent(command), + success: function(data,status,jqXHR){ + if($('error',data).text()){ + $('#error_container').append('
    '+$('error',data).text()+'
    '); + $('#window_error').dialog('open'); + } + updateStreams(); + } }); } - } } -function sendBatchVLMCmd(command){ +function sendBatchVLMCmd(command,append){ var commands = command.split(';'); $.ajax({ url: 'requests/vlm_cmd.xml', data: 'command='+encodeURIComponent(commands.shift()), success:function(data,status,jqXHR){ - sendVLMCmd(commands.join(';')); + if($('error',data).text()){ + $('#error_container').append('
    '+$('error',data).text()+'
    '); + $('#window_error').dialog('open'); + } + sendVLMCmd(commands.join(';'),append); } }); } +function sendEQCmd(params){ + $.ajax({ + url: 'requests/equalizer.xml', + data: params, + success: function(data,status,jqXHR){ + updateEQ(); + } + }); +} + $(function(){ $('#libraryTree').jstree({ "xml_data":{ "ajax":{ - "url" : "requests/playlist.xml" + "url" : "requests/playlist_jstree.xml" }, "xsl" : "nest" }, @@ -317,4 +450,5 @@ $(function(){ }); updateStatus(); updateStreams(); + updateEQ(); }); diff --git a/share/lua/http/js/ui.js b/share/lua/http/js/ui.js new file mode 100644 index 0000000000..fbef9ff192 --- /dev/null +++ b/share/lua/http/js/ui.js @@ -0,0 +1,72 @@ +$(function(){ + $( "#seekSlider" ).slider({ + range: "min", + value: 0, + min: 0, + max: 100, + stop: function( event, ui ) { + $( "#currentTime" ).empty().append( format_time(Math.round((ui.value/100)*$('#seekSlider').attr('totalLength'))) ); + switch(current_que){ + case 'main': + sendCommand({'command':'seek','val':Math.round((ui.value/100)*$('#seekSlider').attr('totalLength'))}); + break; + case 'stream': + sendVLMCmd('control Current seek '+ui.value); + break; + } + } + }); + $( "#volumeSlider" ).slider({ + range: "min", + value: 50, + min: 0, + max: 100, + stop: function( event, ui ) { + $( "#currentVolume" ).empty().append( ui.value+"%" ); + sendCommand({ + 'command':'volume', + 'val':Math.round(ui.value*5.12) + }) + } + }); + $('#buttonStop').click(function(){ + switch(current_que){ + case 'main': + sendCommand({'command' : 'pl_stop'}) + break; + case 'stream': + sendVLMCmd('control Current stop'); + break; + } + return false; + }); + $('#buttonPlay').click(function(){ + if($(this).attr('state')=='stopped'){ + switch(current_que){ + case 'main': + var id = $('.jstree-clicked','#libraryTree').length>0 ? $('.jstree-clicked','#libraryTree').first().parents().first().attr('id').substr(5) : current_id; + sendCommand({'command':'pl_play','id':id}); + break; + case 'stream': + sendVLMCmd('control Current play'); + flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf"); + break; + } + }else{ + switch(current_que){ + case 'main': + sendCommand({'command':'pl_pause'}); + break; + case 'stream': + sendVLMCmd('control Current pause'); + break; + } + } + return false; + }); + $('#buttonFull').click(function(){ + sendCommand({'command':'fullscreen'}); + return false; + }); + $('#stream_host').val(stream_server); +}) \ No newline at end of file diff --git a/share/lua/http/mobile.html b/share/lua/http/mobile.html new file mode 100644 index 0000000000..885c85c4f5 --- /dev/null +++ b/share/lua/http/mobile.html @@ -0,0 +1,122 @@ + + + + VLC media player - Web Interface + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    + Album Art + +
    +
    +
    +
    +
     
    +
    volume
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + +
    +
    00:00:00
    +
    +
    00:00:00
    +
    +
    +
    + + + \ No newline at end of file diff --git a/share/lua/http/mobile_browse.html b/share/lua/http/mobile_browse.html new file mode 100644 index 0000000000..314da74ef3 --- /dev/null +++ b/share/lua/http/mobile_browse.html @@ -0,0 +1,54 @@ + + + + VLC media player - Web Interface + + + + + + + + + + + + + + +
    +
    +
      +
    1. Play List
    2. +
    +
    +
    + + \ No newline at end of file diff --git a/share/lua/http/mobile_equalizer.html b/share/lua/http/mobile_equalizer.html new file mode 100644 index 0000000000..310eb406c2 --- /dev/null +++ b/share/lua/http/mobile_equalizer.html @@ -0,0 +1,70 @@ + + + + VLC media player - Web Interface + + + + + + + + + + + + + + +
    +
    +
    Preamp: 0dB
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/share/lua/http/mobile_view.html b/share/lua/http/mobile_view.html new file mode 100644 index 0000000000..b84b2d7652 --- /dev/null +++ b/share/lua/http/mobile_view.html @@ -0,0 +1,55 @@ + + + + VLC media player - Web Interface + + + + + + + + + + + + + + + +
    + +
    + + + \ No newline at end of file diff --git a/share/lua/http/requests/playlist.xml b/share/lua/http/requests/playlist.xml index d8bbe02eb2..23fdb64b95 100644 --- a/share/lua/http/requests/playlist.xml +++ b/share/lua/http/requests/playlist.xml @@ -6,25 +6,25 @@ vim:syntax=lua < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > < Copyright (C) 2005-2006 the VideoLAN team < $Id$ -< +< < Authors: Antoine Cellerier -< +< < This program is free software; you can redistribute it and/or modify < it under the terms of the GNU General Public License as published by < the Free Software Foundation; either version 2 of the License, or < (at your option) any later version. -< +< < This program is distributed in the hope that it will be useful, < but WITHOUT ANY WARRANTY; without even the implied warranty of < MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the < GNU General Public License for more details. -< +< < You should have received a copy of the GNU General Public License < along with this program; if not, write to the Free Software < Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> ]] ?> - + ' ..name.. '') - for _, child in ipairs(item.children) do - print_playlist(child) - end - print('') - else - for _, child in ipairs(item.children) do - print_playlist(child) - end - end + print('') + for _, child in ipairs(item.children) do + print_playlist(child) + end + print('') else local name, path = vlc.strings.convert_xml_special_chars(item.name or "", item.path or "") local current_item = vlc.input.item() @@ -63,7 +57,7 @@ function print_playlist(item) current = 'current="current"' end end - print('' ..name.. '') + print('') end end @@ -82,4 +76,3 @@ end --a(p) --Uncomment to debug print_playlist(p) ?> - \ No newline at end of file diff --git a/share/lua/http/requests/playlist_jstree.xml b/share/lua/http/requests/playlist_jstree.xml new file mode 100644 index 0000000000..d8bbe02eb2 --- /dev/null +++ b/share/lua/http/requests/playlist_jstree.xml @@ -0,0 +1,85 @@ +'?> + +< playlist.xml: VLC media player web interface +< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > +< Copyright (C) 2005-2006 the VideoLAN team +< $Id$ +< +< Authors: Antoine Cellerier +< +< This program is free software; you can redistribute it and/or modify +< it under the terms of the GNU General Public License as published by +< the Free Software Foundation; either version 2 of the License, or +< (at your option) any later version. +< +< This program is distributed in the hope that it will be useful, +< but WITHOUT ANY WARRANTY; without even the implied warranty of +< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +< GNU General Public License for more details. +< +< You should have received a copy of the GNU General Public License +< along with this program; if not, write to the Free Software +< Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. +< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +]] ?> + +' ..name.. '') + for _, child in ipairs(item.children) do + print_playlist(child) + end + print('') + else + for _, child in ipairs(item.children) do + print_playlist(child) + end + end + else + local name, path = vlc.strings.convert_xml_special_chars(item.name or "", item.path or "") + local current_item = vlc.input.item() + local current = "" + -- Is the item the one currently played + if(current_item ~= nil) then + if(vlc.input.item().uri(current_item) == path) then + current = 'current="current"' + end + end + print('' ..name.. '') + end +end + +local p +if _GET["search"] then + if _GET["search"] ~= "" then + _G.search_key = _GET["search"] + else + _G.search_key = nil + end + local key = vlc.strings.decode_uri(_GET["search"]) + p = vlc.playlist.search(key) +else + p = vlc.playlist.get() +end +--a(p) --Uncomment to debug +print_playlist(p) +?> + \ No newline at end of file diff --git a/share/lua/http/view.html b/share/lua/http/view.html index e1d646b9ac..99fd531d60 100644 --- a/share/lua/http/view.html +++ b/share/lua/http/view.html @@ -1,16 +1,39 @@ - + VLC media player - Flash Viewer + + - - + +