Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- : class="re0">Begin batch
- @echo off
- set "selfHta=%~0"
- if [%1]==[] (
- echo zum Starten ziehe die .m3u-Playlisten mit den Streamadressen auf: "%~nx0"
- pause
- exit /b
- )
- for %%x in (%*) do (
- for /f "usebackq" %%a in ("%%~x") do (
- echo %%a|find "http://" && (
- call :HTA_RadioPlay %%a /"%%~nxx"
- ) ) )
- timeout 3
- exit /b
- :check_running
- :HTA_RadioPlay
- rem params: optional audiofile optional /Titlestring
- rem if in hta the content="ie=edge" the commandline not working, but the Hta can get the arguments from Environ Var...
- set "$$$_HTA_AudioPlay=%~1"
- set "$$$_HTA_AudioPlay=%$$$_HTA_AudioPlay:/=\% %~2"
- start "ik" mshta.exe "%selfHta%" %$$$_HTA_AudioPlay%
- exit /b
- -->
- <!DOCTYPE html>
- <meta http-equiv="x-ua-compatible" content="ie=9">
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title>RadioPlayer</title>
- <!-- die HTA- Fenstereinstellungen funktionieren nur bis content="ie=edge" bei "ie=9" funktioniert jedoch HTML5 -->
- <hta:application
- ID="oHTA"
- applicationname="RadioPlay"
- border="thin"
- borderstyle="static"
- caption="yes"
- contextmenu="no"
- icon="no"
- innerborder="no"
- maximizebutton="yes"
- minimizebutton="yes"
- navigable="no"
- scroll="no"
- scrollflat="no"
- selection="no"
- showintaskbar="yes"
- singleinstance="no"
- sysmenu="yes"
- version="1.0"
- windowState="normal" >
- <html>
- <style type="text/css">
- body{
- color: white; /* global Fontcolor*/
- background-color: black;
- }
- </style>
- <body>
- keep playing:<input type="checkbox" id="keep_Play_checkbox">
- <div id="demo"></div>
- <audio id="radioplayer" src="http://s1.slotex.pl:7196/;stream.mp3" autoplay="autoplay" preload="none"></audio>
- </body>
- <script>
- var wsh = new ActiveXObject("wscript.shell");
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- window.resizeTo(500,100)
- if (typeof oHTA.commandLine !== 'undefined')
- { var args=splitCmdLn(oHTA.commandLine);}
- else
- {
- var args=splitCmdLn('%$$$_HTA_AudioPlay% /' + wsh.ExpandEnvironmentStrings('%$$$_HTA_AudioPlay%').replace('$$$_HTA_AudioPlay',''));
- }
- changeStream(args[0], args[1])
- var watchActiveState=setInterval("WatchFocus()", 100);
- function changeStream(audiofile, title)
- {
- if (audiofile != '')
- {
- document.getElementById('radioplayer').src=audiofile.replace(/\\/g,'/');
- document.title = title;
- } };
- function WatchFocus() {
- var x = document.getElementById("demo");
- if (document.hasFocus())
- {
- x.innerHTML = "playing..."+args[0].replace(/\\/g,'/');
- document.getElementById('radioplayer').play();
- }
- else
- {
- if (!document.getElementById("keep_Play_checkbox").checked)
- {
- x.innerHTML = "pause";
- document.getElementById('radioplayer').pause()
- } } };
- function splitCmdLn(cmdLn)
- {
- var tempArr = cmdLn.replace(/" /g,'/').replace(/\/\//,'/').replace(/"/g,'');
- tempArr = tempArr.split('/');
- tempArr.shift(); //remove Destination of Commandline
- if (!/\./.test(tempArr[0])) //if first element is not a filename... (every filename incl. a Point)
- {
- tempArr.unshift('');
- alert(tempArr)
- }
- return tempArr;
- };
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement