Myntrith [OP] 1 points 6y ago
OK ...
Step 1, of course, was to get the URL for the stream. In my case, this was: http://ewtn.com/live/ewtnplayer/jwplayer.asp?bottom=false&feed=domeng
I had two problems with that. First, it loaded the stream, but wouldn't automatically play it. A friend helped me figure out that the HTML source on the page included an "autoplay" parameter that was set to false. So I copied the HTML source to a local HTML file on my local drive, and changed the autoplay parameter to TRUE.
Now, instead of invoking the remote URL, I invoked the local file path ... which brought me to the second problem. Internet Explorer would pop-up a notification that content was blocked, and did I want to allow it? To get around this, I had to add a line at the beginning of the local HTML file.
<!-- saved from url=(0016)http://localhost -->
Step 2: The Powershell script to start the stream:
$isrunning = Get-Process | where {$_.name -eq 'iexplore'}
if (-not $isrunning) {
$ie = new-object -ComObject "InternetExplorer.Application"
$ie.visible = $true
$ie.silent = $true
$ie.navigate('file:///C:/Users/Myntrith/Desktop/ewtn.html')
}
The first line sets up a test for the if block to see if Internet Explorer is currently running. It only executes the rest of the script if it is NOT running. This avoids starting multiple video streams.
No one uses this computer except to check things for her, so Internet Explorer should not normally be running unless she's activating this stream.
Step 3: The Powershell script to close the stream.
$isrunning = Get-Process | where {$_.name -eq 'iexplore'}
if ($isrunning) {
Stop-Process -processname iexplore
}
Again, all this does is it checks to see if Internet Explorer is running, and if so, it stops it. If multiple instances are running, it stops all instances.
Step 4: Create shortcuts for each of the scripts. Creating a shortcut allows you to assign a hotkey. Don't assign the hotkey yet, just create a shortcut.
Step 5: Make sure you have your keyboard or mouse software installed. For Logitech, this software is called SetPoint.
I open Setpoint, and I select the mouse's forward button, and select "Keystroke Assignment". I assigned CTRL-ALT-E as the keystroke.
I select the mouse's back button, and select "Keystroke Assignment." I assigned CTRL-ALT-N.
Now, for the shortcut to the start script, I right-click and select Properties. There's an entry in there for "Shortcut Key". I select that entry and press E. (It assumes the CTRL-ALT, so you only have to press E.)
Likewise for the shortcut to the stop script, except I select N instead of E.
And that's it. Now, pressing the forward mouse button should invoke the CTRL-ALT-E hotkey, which should invoke the shortcut to the start script, which invokes the start script itself, which invokes the local HTML file which invokes the video stream.
Likewise with the back mouse button and CTRL-ALT-N and the stop script.
If things don't work, you troubleshoot step by step to see where the problem is. Invoke the script directly to see if that works.
If it does, invoke the shortcut directly to see if that works.
If it does, invoke the shortcut through the hotkey to see if that works.
If it does, try the mouse button again.
Wherever it fails should tell you where the problem is.
It does seem like the shortcuts to the scripts have to be on the desktop in order for the hotkey to work properly. I haven't tested this extensively, but with what I have tested so far that seems to be an important bit.