home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / vlc-2-0-5-win32.exe / lua / http / js / ui.js < prev   
Text File  |  2012-12-12  |  3KB  |  104 lines

  1. $(function () {
  2.     $("#seekSlider").slider({
  3.         range: "min",
  4.         value: 0,
  5.         min: 0,
  6.         max: 100,
  7.         start: function (event, ui) {
  8.             $("#seekSlider").data( 'clicked', true );
  9.         },
  10.         stop: function (event, ui) {
  11.             $("#currentTime").empty().append(format_time(Math.round((ui.value / 100) * $('#seekSlider').attr('totalLength'))));
  12.             switch (current_que) {
  13.             case 'main':
  14.                 sendCommand({
  15.                     'command': 'seek',
  16.                     'val': (ui.value) + '%'
  17.                 });
  18.                 break;
  19.             case 'stream':
  20.                 sendVLMCmd('control Current seek ' + ui.value);
  21.                 break;
  22.             }
  23.             $("#seekSlider").data( 'clicked', false );
  24.         }
  25.     });
  26.     $("#volumeSlider").slider({
  27.         range: "min",
  28.         value: 50,
  29.         min: 0,
  30.         max: 100,
  31.         start: function (event, ui) {
  32.             $("#volumeSlider").data( 'clicked', true );
  33.         },
  34.         stop: function (event, ui) {
  35.             $("#currentVolume").empty().append(ui.value * 2 + "%");
  36.             sendCommand({
  37.                 'command': 'volume',
  38.                 'val': Math.round(ui.value * 5.12)
  39.             })
  40.             $("#volumeSlider").data( 'clicked', false );
  41.         }
  42.     });
  43.     /* To ensure that updateStatus() doesn't interfere while the user
  44.      * slides the controls. */
  45.     $("#seekSlider").data( 'clicked', false );
  46.     $("#volumeSlider").data( 'clicked', false );
  47.     $('#buttonStop').click(function () {
  48.         switch (current_que) {
  49.         case 'main':
  50.             sendCommand({
  51.                 'command': 'pl_stop'
  52.             })
  53.             break;
  54.         case 'stream':
  55.             sendVLMCmd('control Current stop');
  56.             break;
  57.         }
  58.         return false;
  59.     });
  60.     $('#buttonPlay').click(function () {
  61.         if ($(this).attr('state') == 'stopped') {
  62.             switch (current_que) {
  63.             case 'main':
  64.                 var id = $('.jstree-clicked', '#libraryTree').length > 0 ? $('.jstree-clicked', '#libraryTree').first().parents().first().attr('id').substr(5) : current_id;
  65.                 sendCommand({
  66.                     'command': 'pl_play',
  67.                     'id': id
  68.                 });
  69.                 break;
  70.             case 'stream':
  71.                 sendVLMCmd('control Current play');
  72.                 flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf");
  73.                 break;
  74.             }
  75.         } else {
  76.             switch (current_que) {
  77.             case 'main':
  78.                 sendCommand({
  79.                     'command': 'pl_pause'
  80.                 });
  81.                 break;
  82.             case 'stream':
  83.                 sendVLMCmd('control Current pause');
  84.                 break;
  85.             }
  86.         }
  87.         return false;
  88.     });
  89.     $('#buttonFull').click(function () {
  90.         sendCommand({
  91.             'command': 'fullscreen'
  92.         });
  93.         return false;
  94.     });
  95.     $('#stream_host').val(stream_server);
  96.     $('#mobileintflink').click(function () {
  97.         var urlimg = location.href + '/mobile.html';
  98.         var codeimg = $('<img width="350" height="350" alt="qrcode"/>');
  99.         codeimg.attr('src', 'http://chart.apis.google.com/chart?cht=qr&chs=350x350&chld=L&choe=UTF-8&chl=' + encodeURIComponent(urlimg));
  100.         codeimg.dialog({width: 350, height: 350, title: 'QR-Code'});
  101.         return false;
  102.     });
  103. })
  104.