XBMC and Hulu Desktop playing nice solution
#1
Thumbs Up 
Inspiration and improvements from post located here. Thanks thesuffering! (This thread is a continuation from thesuffering's thread. Use it as reference as needed.)

I've been trying to integrate Hulu Desktop into XBMC but I kept having problems. After tearing my hair out for a few days and after finding thesufferings work and making a few changes, I now have something I'm happy with.


Alright, here we go!

The Problem - When selecting Hulu Desktop from XBMC, Hulu would load in the background and never get focus. This post fixes that problem.

Programs used - AutoHotKey, EventGhost, XBMC, Hulu Desktop.

I've attached a photo so please reference that for the list below.
Image

Starting with AutoStart, my HTPC opens EventGhost at startup, then EventGhost is what starts everything else for me.

AutoStart
Start Program: CPWizard.exe - CPWizard is a program I use to display MAME information when I play my arcade games.

Plugin: Directory Watcher - It's used to watch a folder when I download TV Shows. Article on this setup is here.

Plugin: Directory Watcher #2 - Disregard, it needs to be deleted as it currently has no function.

Plugin: XBMC - Plugin which gives me XBMC macros.

Plugin: Task Create/Switch Events - Keeps track of events from apps that you open and close and allows you to run macros after any event that you choose.

Continued Startup
After CPWizard - I was having issues with CPWizard. Initially I had CPWizard and XBMC in the Autostart above but CPWizard would load AFTER XBMC and for whatever reason, it would minimize XBMC. I would then have to grab my mouse and select XBMC from the Task Bar to open it/give it focus.

This is where the Plugin: Task Create/Switch Events comes into play. When CPWizard opens, it also minimizes and the event when it minimizes is Task.ClosedWindow.CPWizard so I told EventGhost that when it notices CPWizard minimize, to start XBMC. Doing so fixed the minimizing of XBMC.

The next two lines are for TED (Torrent Episode Downloader). TED is java based and JAVA kept crashing on my system when I started TED too early. What I did was created a 30 sec wait, after XBMC has loaded, to launch TED. It launches in the background and never messes with XBMC.

Launching Hulu
The problem with Hulu was it not focusing. You would select it from your list on XBMC, it would change to Hulu for a fraction of a sec and then it would come back to XBMC. This is what I did:

Focus Hulu
Launching Hulu - Using the Task Create/Switch Events plugin, I set the Task.Created.HuluDesktop event so that when EventGhost sees that event, it launches any macros after it and in this case, it's Quitting XBMC. The Quit XBMC macro can be found in the XBMC Plugin.

This didn't fix all my problems, only half. It quits XBMC but I still had issues with the focus. Even though it seemed Hulu Desktop was in the foreground, it wasn't, Windows was. I would need to click on Hulu Desktop before I would be able to control it with my remote. In order to fix it, the next macro needs to run.

Giving Focus to Hulu - The previous macro quits XBMC and one of the events created is Task.Destroyed.XBMC. When EventGhost sees that, it starts the program FocusHulu.exe. FocusHulu.exe is a compiled and modified version of the AHK script thesuffering (OP) had running in the background. Even though it worked, it had it's issues. The script was in a constant loop in the background and it didn't allow you to quit XBMC without it reopening it a second later.

Copy the following script into notepad and make sure it has the ahk extension.
Code:
{
IfWinExist, Hulu Desktop
{
WinActivate, Hulu Desktop
}
}

I tried running the ahk script through EventGhost but I kept getting errors. What I did instead was compile it with the compiler(Ahk2exe) found in Compiler folder of AutoHotKey. When you open ahk2exe, select the script and then from the File menu, select convert. Once finished, you'll have an executable! The beauty of this, if you haven't figured it out yet, is that it only runs when XBMC quits and if you decide quit XBMC, for any reason,, the script will run but since Hulu Desktop is not running, it won't have anything to activate, so it does nothing. It only focus on Hulu Desktop when you run Hulu Desktop. And now for the last part.

Launching XBMC after Quitting Hulu - When EventGhost notices you closing Hulu (Task.Destroyed.HuluDesktop), it runs the Start Program macro for XBMC. The rest, as they say is history!

Any questions let me know.
Reply
#2
WickedxWeasel Wrote:Inspiration and improvements from post located here. Thanks thesuffering! (This thread is a continuation from thesuffering's thread. Use it as reference as needed.)

I've been trying to integrate Hulu Desktop into XBMC but I kept having problems. After tearing my hair out for a few days and after finding thesufferings work and making a few changes, I now have something I'm happy with.


Alright, here we go!

The Problem - When selecting Hulu Desktop from XBMC, Hulu would load in the background and never get focus. This post fixes that problem.

Programs used - AutoHotKey, EventGhost, XBMC, Hulu Desktop.

I've attached a photo so please reference that for the list below.
Image

Starting with AutoStart, my HTPC opens EventGhost at startup, then EventGhost is what starts everything else for me.

AutoStart
Start Program: CPWizard.exe - CPWizard is a program I use to display MAME information when I play my arcade games.

Plugin: Directory Watcher - It's used to watch a folder when I download TV Shows. Article on this setup is here.

Plugin: Directory Watcher #2 - Disregard, it needs to be deleted as it currently has no function.

Plugin: XBMC - Plugin which gives me XBMC macros.

Plugin: Task Create/Switch Events - Keeps track of events from apps that you open and close and allows you to run macros after any event that you choose.

Continued Startup
After CPWizard - I was having issues with CPWizard. Initially I had CPWizard and XBMC in the Autostart above but CPWizard would load AFTER XBMC and for whatever reason, it would minimize XBMC. I would then have to grab my mouse and select XBMC from the Task Bar to open it/give it focus.

This is where the Plugin: Task Create/Switch Events comes into play. When CPWizard opens, it also minimizes and the event when it minimizes is Task.ClosedWindow.CPWizard so I told EventGhost that when it notices CPWizard minimize, to start XBMC. Doing so fixed the minimizing of XBMC.

The next two lines are for TED (Torrent Episode Downloader). TED is java based and JAVA kept crashing on my system when I started TED too early. What I did was created a 30 sec wait, after XBMC has loaded, to launch TED. It launches in the background and never messes with XBMC.

Launching Hulu
The problem with Hulu was it not focusing. You would select it from your list on XBMC, it would change to Hulu for a fraction of a sec and then it would come back to XBMC. This is what I did:

Focus Hulu
Launching Hulu - Using the Task Create/Switch Events plugin, I set the Task.Created.HuluDesktop event so that when EventGhost sees that event, it launches any macros after it and in this case, it's Quitting XBMC. The Quit XBMC macro can be found in the XBMC Plugin.

This didn't fix all my problems, only half. It quits XBMC but I still had issues with the focus. Even though it seemed Hulu Desktop was in the foreground, it wasn't, Windows was. I would need to click on Hulu Desktop before I would be able to control it with my remote. In order to fix it, the next macro needs to run.

Giving Focus to Hulu - The previous macro quits XBMC and one of the events created is Task.Destroyed.XBMC. When EventGhost sees that, it starts the program FocusHulu.exe. FocusHulu.exe is a compiled and modified version of the AHK script thesuffering (OP) had running in the background. Even though it worked, it had it's issues. The script was in a constant loop in the background and it didn't allow you to quit XBMC without it reopening it a second later.

Copy the following script into notepad and make sure it has the ahk extension.
Code:
{
IfWinExist, Hulu Desktop
{
WinActivate, Hulu Desktop
}
}

I tried running the ahk script through EventGhost but I kept getting errors. What I did instead was compile it with the compiler(Ahk2exe) found in Compiler folder of AutoHotKey. When you open ahk2exe, select the script and then from the File menu, select convert. Once finished, you'll have an executable! The beauty of this, if you haven't figured it out yet, is that it only runs when XBMC quits and if you decide quit XBMC, for any reason,, the script will run but since Hulu Desktop is not running, it won't have anything to activate, so it does nothing. It only focus on Hulu Desktop when you run Hulu Desktop. And now for the last part.

Launching XBMC after Quitting Hulu - When EventGhost notices you closing Hulu (Task.Destroyed.HuluDesktop), it runs the Start Program macro for XBMC. The rest, as they say is history!

Any questions let me know.

it looks using the eventghost method, you should also be able to implement this into other external programs as well. next up for me?

NETFLIX

Windows Media Center has a nice netflix app built in. You can launch directly into it with this shortcut
windowsmediacenterapp:{e6f46126-f8a9-4a97-9159-b70b07890112}\{982ea9d3-915c-4713-a3c8-99a4688b7c59}?EntryPointParameters=

launcher wont open shortcuts, the solution? create a .bat file.
open notepad
type:
Start windowsmediacenterapp:{e6f46126-f8a9-4a97-9159-b70b07890112}\{982ea9d3-915c-4713-a3c8-99a4688b7c59}?EntryPointParameters=

and save it as whatever.bat and point launcher to that.

only problem i can see so far is you can exit directly out of it with the remote (itll go back to WMC). i suppose you could use eventghost to take a remote key press as an instruction to kill it, but still not as fluid. would be nice if netflix had its own standalone program
Reply
#3
Thanks for the info for Netflix. I read somewhere on the forum about launching straight into Netflix but the guy didn't provide instructions.
Reply
#4
WickedxWeasel Wrote:Thanks for the info for Netflix. I read somewhere on the forum about launching straight into Netflix but the guy didn't provide instructions.

Was it:

http://wiki.xbmc.org/index.php?title=Usi...nal_player

JR
Reply
#5
I had been messing around with trying to run Hulu Desktop and/or Boxee to "integrate" streaming TV into XBMC - but was made aware of this thread by another user - and it's way too cool!

http://forum.xbmc.org/showthread.php?tid=79148

I was never crazy about the Hulu Desktop interface - and while Boxee's interace and ability to setup "MyTvShows" is handy, didn't like how long it took to start a show or the "click any key to go full screen".

Don't know all the details - but this pulls Hulu and many other network and other Internet feeds right into XBMC - no quiting and restarting, no worrying about which program is on top. And the shows start faster - and don't stutter.

I'm thrilled to have found this.
Reply
#6
Before I discovered the Hulu/CBS/Other TV add-ons noted in my previous post - I used to start Hulu Desktop and XBMC together wen my HTPC booted and use my MCE remote to "toggle" between them. This works great as long as you have enough system resources and you can live with the myriad of menus/scrolling you have to do in HUlu Desktop Wink

In the screencap below is my old EG setup (I collapsed the XBMC module where I assigned all the keystrokes as I'm doing that now inside of XBMC). I had reprogrammed my "green button" to start --OR-- bring XBMC to the front (focus) and programmed the LiveTV button to do the same for Hulu Desktop. Both have redundancy built in to START the programs if not already running. The minimize, maximize and bring to front are the key aspects that ensure each is the focus when you want it to be. It works great, instant switching, no screens flashing by just like changing a channel...and XBMC "stays" where you last left off.

I'm sure you could marry the two approaches - starting Hulu desktop from a menu item in XBMC and using EG to minimize/maximize/bring to front. I was running this on a REVO with 4GB of memory and wasn't having any issues leaving both running. I too had played around with the AHK scripts and quiting and starting XBMC - and got stuck in that endless loop of XBMC continually restarting. I wasn't crazy about the idea of having to exit and restart XBMC all the time though.

All personal preferences I know, but hope these EG commands help somebody.

Image
Reply
#7
jhsrennie Wrote:Was it:

http://wiki.xbmc.org/index.php?title=Usi...nal_player

JR

No, but that's good info too. The post was about using the netflix shortcut for the windows media center.
Reply
#8
puulima Wrote:I had been messing around with trying to run Hulu Desktop and/or Boxee to "integrate" streaming TV into XBMC - but was made aware of this thread by another user - and it's way too cool!

http://forum.xbmc.org/showthread.php?tid=79148

I was never crazy about the Hulu Desktop interface - and while Boxee's interace and ability to setup "MyTvShows" is handy, didn't like how long it took to start a show or the "click any key to go full screen".

Don't know all the details - but this pulls Hulu and many other network and other Internet feeds right into XBMC - no quiting and restarting, no worrying about which program is on top. And the shows start faster - and don't stutter.

I'm thrilled to have found this.

Thanks, I just installed it a few hours ago and I'm going to try it out for a few days but it looks promising.
Reply
#9
puulima Wrote:Before I discovered the Hulu/CBS/Other TV add-ons noted in my previous post - I used to start Hulu Desktop and XBMC together wen my HTPC booted and use my MCE remote to "toggle" between them. This works great as long as you have enough system resources and you can live with the myriad of menus/scrolling you have to do in HUlu Desktop Wink

In the screencap below is my old EG setup (I collapsed the XBMC module where I assigned all the keystrokes as I'm doing that now inside of XBMC). I had reprogrammed my "green button" to start --OR-- bring XBMC to the front (focus) and programmed the LiveTV button to do the same for Hulu Desktop. Both have redundancy built in to START the programs if not already running. The minimize, maximize and bring to front are the key aspects that ensure each is the focus when you want it to be. It works great, instant switching, no screens flashing by just like changing a channel...and XBMC "stays" where you last left off.

I'm sure you could marry the two approaches - starting Hulu desktop from a menu item in XBMC and using EG to minimize/maximize/bring to front. I was running this on a REVO with 4GB of memory and wasn't having any issues leaving both running. I too had played around with the AHK scripts and quiting and starting XBMC - and got stuck in that endless loop of XBMC continually restarting. I wasn't crazy about the idea of having to exit and restart XBMC all the time though.

All personal preferences I know, but hope these EG commands help somebody.

Image

I'm so glad you posted this. Initially I wanted to use the "minimize/maximize/bring to front" of EG but I couldn't figure out how to make it work. Looking at your photo, I now know what I was doing wrong. I like your approach better since it knocks out one less program to use (AHK).
Reply
#10
WickedxWeasel Wrote:I'm so glad you posted this. Initially I wanted to use the "minimize/maximize/bring to front" of EG but I couldn't figure out how to make it work. Looking at your photo, I now know what I was doing wrong. I like your approach better since it knocks out one less program to use (AHK).

Glad it helps. I spent a fair bit of time back a few months trying to figure this out - and stumbled (litterally) on several threads outside of XBMC that helped me figure out how to do this. I was trying to run Boxee too (for the steaming TV only) but found that Boxee and XBMC were responding to the remote commands (one of the 2 never stops listening even when not the focus). But now that I have this Hulu add-on, life is good.

Hopefully BlueCop can fix the Favorites issue so I can create a custom list of Fave shows.
Reply
#11
puulima Wrote:Hopefully BlueCop can fix the Favorites issue so I can create a custom list of Fave shows.

That would make things simpler! By any chance, have you noticed any issues with pausing video from Hulu? Every time I've pause and unpaused it, with-in a minute or so my video stops and I have to restart it from the beginning.
Reply
#12
WickedxWeasel Wrote:That would make things simpler! By any chance, have you noticed any issues with pausing video from Hulu? Every time I've pause and unpaused it, with-in a minute or so my video stops and I have to restart it from the beginning.

Yeah, that is an issue. I read about that somewhere - probably in BlueCop's thread. Not sure what the technical aspect is behind that. My wife noted this isn't an issue with the CBS plugin - well at least not with the Soap she watches. At least there's no commercials Wink

Edit: here's the reference to pausing...again, not sure what the technical aspect is but I think I'll ask BlueCop - but want to check if CBS truly does pause/resume successfully.

http://forum.xbmc.org/showpost.php?p=594...stcount=54
Reply
#13
puulima Wrote:Yeah, that is an issue. I read about that somewhere - probably in BlueCop's thread. Not sure what the technical aspect is behind that. My wife noted this isn't an issue with the CBS plugin - well at least not with the Soap she watches. At least there's no commercials Wink

Edit: here's the reference to pausing...again, not sure what the technical aspect is but I think I'll ask BlueCop - but want to check if CBS truly does pause/resume successfully.

http://forum.xbmc.org/showpost.php?p=594...stcount=54

Thanks for the reply and the info on pausing. It's just a minor annoyance to a great addon.
Reply
#14
Hey guys. Hope you don't mind me asking for some help with this. I know i'm resurrecting a few month old post.

Okay first of all I'm new to Event Ghost and I think I have a decent grasp on using it. I've basically tried to copy WickedxWeasel's original stuff and instead of using that compiled app .AHK I'm trying the puulima approach with the Minimize, Maximize, bring to front.

My first basic question is. Once you build out the Config tree like you want in Event Ghost. How do you fire it off? DO you have to open EG every time and go right click the "Start Program: XBMC.exe"?

Here is how I currently have mine setup. Please let me know youf you see something wrong.

Its acting a little strange and not quite working correctly with maximizing the screen. Its also in a loop so you can never shut down XBMC without it bringing up HuluDesktop. Then close Hulu and it brings XBMC back up.

http://img19.imageshack.us/img19/6006/42463133.png
Reply
#15
I also need a better way to launch Hulu desktop from XBMC. I'm currently going from the home screen to "Progams / Launcher / Hulu Desktop". I got Hulu to maximize but it immediately crashes and brings up the windows "A problem occurred with your pgrm".
Reply



Logout Mark Read Team Forum Stats Members Help
XBMC and Hulu Desktop playing nice solution0
This forum uses Lukasz Tkacz MyBB addons.