Advertisement
Guest User

selectiv_audioplayer v0.0.2a

a guest
May 15th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.45 KB | None | 0 0
  1. <!-- : class="re0">Begin batch
  2. @echo off
  3. set "selfHta=%~0"
  4. if [%1]==[] (
  5.  
  6.     echo zum Starten ziehe die .m3u-Playlisten mit den Streamadressen auf: "%~nx0"
  7.     pause
  8.     exit /b
  9. )
  10.  
  11. for %%x in (%*) do (    
  12.     for /f "usebackq" %%a in ("%%~x") do (
  13.         echo %%a|find "http://" && (
  14.             call :HTA_RadioPlay  %%a /"%%~nxx"
  15. )   )   )
  16.  
  17. timeout 3
  18. exit /b
  19. :check_running
  20.  
  21. :HTA_RadioPlay
  22.      rem params: optional audiofile  optional /Titlestring
  23.      rem if in hta the content="ie=edge" the commandline not working, but the Hta can get the arguments from Environ Var...
  24. set "$$$_HTA_AudioPlay=%~1"
  25. set "$$$_HTA_AudioPlay=%$$$_HTA_AudioPlay:/=\% %~2"
  26. start "ik"  mshta.exe "%selfHta%" %$$$_HTA_AudioPlay%
  27. exit /b
  28.  
  29. -->
  30. <!DOCTYPE html>
  31. <meta http-equiv="x-ua-compatible" content="ie=9">
  32. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  33.  
  34. <title>RadioPlayer</title>
  35. <!-- die HTA- Fenstereinstellungen  funktionieren nur bis content="ie=edge"  bei "ie=9"  funktioniert jedoch  HTML5 -->
  36.  
  37.   <hta:application
  38.     ID="oHTA"
  39.     applicationname="RadioPlay"
  40.     border="thin"
  41.     borderstyle="static"
  42.     caption="yes"
  43.     contextmenu="no"
  44.     icon="no"
  45.     innerborder="no"
  46.     maximizebutton="yes"
  47.     minimizebutton="yes"
  48.     navigable="no"
  49.     scroll="no"
  50.     scrollflat="no"
  51.     selection="no"
  52.     showintaskbar="yes"
  53.     singleinstance="no"
  54.     sysmenu="yes"
  55.     version="1.0"
  56.     windowState="normal" >
  57. <html>
  58.   <style type="text/css">
  59.     body{
  60.       color: white;  /* global Fontcolor*/    
  61.       background-color: black;
  62.     }
  63.   </style>
  64.   <body>
  65.     keep playing:<input type="checkbox" id="keep_Play_checkbox">
  66.     <div id="demo"></div>
  67.     <audio id="radioplayer" src="http://s1.slotex.pl:7196/;stream.mp3" autoplay="autoplay" preload="none"></audio>
  68.   </body>
  69.  
  70.   <script>
  71.   var wsh = new ActiveXObject("wscript.shell");
  72.   var fso = new ActiveXObject("Scripting.FileSystemObject");
  73.   window.resizeTo(500,100)
  74.  
  75.   if (typeof oHTA.commandLine !== 'undefined')
  76.   {   var args=splitCmdLn(oHTA.commandLine);}
  77.   else
  78.   {  
  79.       var args=splitCmdLn('%$$$_HTA_AudioPlay% /' + wsh.ExpandEnvironmentStrings('%$$$_HTA_AudioPlay%').replace('$$$_HTA_AudioPlay',''));
  80.   }
  81.  
  82.   changeStream(args[0], args[1])
  83.  
  84.   var watchActiveState=setInterval("WatchFocus()", 100);
  85.  
  86.   function changeStream(audiofile, title)
  87.   {
  88.       if (audiofile != '')
  89.       {
  90.           document.getElementById('radioplayer').src=audiofile.replace(/\\/g,'/');
  91.           document.title = title;
  92.   }   };
  93.  
  94.   function WatchFocus() {
  95.       var x = document.getElementById("demo");
  96.       if (document.hasFocus())
  97.       {
  98.           x.innerHTML = "playing..."+args[0].replace(/\\/g,'/');
  99.           document.getElementById('radioplayer').play();
  100.       }
  101.       else
  102.       {    
  103.           if (!document.getElementById("keep_Play_checkbox").checked)
  104.           {
  105.               x.innerHTML = "pause";
  106.               document.getElementById('radioplayer').pause()
  107.   }   }   };
  108.  
  109.   function splitCmdLn(cmdLn)
  110.   {
  111.       var tempArr = cmdLn.replace(/" /g,'/').replace(/\/\//,'/').replace(/"/g,'');
  112.       tempArr = tempArr.split('/');
  113.      
  114.       tempArr.shift(); //remove Destination of Commandline
  115.      
  116.       if (!/\./.test(tempArr[0])) //if first element is not a filename... (every filename incl. a Point)
  117.       {
  118.           tempArr.unshift('');
  119.           alert(tempArr)
  120.       }  
  121.       return tempArr;
  122.   };
  123.  
  124. </script>
  125. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement