• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 47
[RELEASE] Chrome Launcher
#76
(2014-01-21, 23:09)rob hodge Wrote: alright, here's my solution for XBMCbuntu and chrome launcher, with remote control.

this implementation wraps chromium in a snuggly blanket of openbox and irexec so that focus and fullscreen AND remote control all function.

[snip]

so far, this is working except of the extra tab opening sometimes. as i said, anyone want to look into that, let me know what you find. i'll muck about at it but i think it's something i'm missing and a second set of eyes would find it.

I've started looking at the source code for this and the NetfliXBMC and Amazon Prime plugins that use it, and the biggest issue, IMO, is closing the Chrome window, and that should be fairly easy to implement. The Chrome launcher uses the following command to launch the browser:

Code:
subprocess.Popen(fullUrl, shell=True)

subprocess.Popen returns the process ID (PID) for that process, which could be captured within the plugin's variable space. This could later be used to kill the specific browser instance, rather than killing all open Chrome/Chromium browsers. e.g.:

Code:
browser = subprocess.Popen(fullUrl, shell=False)
...
browser.kill()
The kill function could be called by the Chrome Launcher whenever one navigates away via the "BACK" button by adding the kill function to any mode that is not 'showSite', or can be called independently by the plugin that initiated the Chrome Launcher, e.g. NetfliXBMC. I'm still very new to plugin development, and Python in general, so I'm sure that there are other hurdles that would need to be overcome. I would especially love to be able to map XBMC actions directly, such as "pause", "fast forward", etc., so that each plugin could map the appropriate keystrokes to the player it is displaying and not have to worry if it is coming from a physical remote ala lirc or from XBMC's web remote.
Reply
#77
Quick update: the good news is that my work-in-progress successfully captures the PID of the process that launches Chrome. The bad news is that the google-chrome launch application is more of a script that launches other processes, and I need to find a way to reliably find the main Chrome process instead.
Reply
#78
(2014-01-21, 23:09)rob hodge Wrote: alright, here's my solution for XBMCbuntu and chrome launcher, with remote control.....

I dont use this addon but I'm in the same boat. I use irxevent to control, here is the ~/.lircrc for it (a couple of keys are tailored to Youtube couch mode/chromium but it works with Steam and other sites):

Code:
###irxevent
begin
prog = irxevent
button = KEY_UP
repeat = 1
config = Key Up CurrentWindow
end

begin
prog = irxevent
button = KEY_DOWN
repeat = 1
config = Key Down CurrentWindow
end

begin
prog = irxevent
button = KEY_LEFT
repeat = 1
config = Key Left CurrentWindow
end

begin
prog = irxevent
button = KEY_RIGHT
repeat = 1
config = Key Right CurrentWindow
end

begin
prog = irxevent
button = KEY_PLAY
config = Key Return CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_ENTER
config = Key Return CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_AUDIO
config = Key ALT-Home CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_CAMERA
config = Key s CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_ZOOM
config = Key ALT-F4 CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_BACK
config = Key Escape CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_INFO
config = Key F11 CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_DVD
config = Key F11 CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_CHANNELUP
config = Key Page_Up CurrentWindow
repeat = 1
end

begin
prog = irxevent
button = KEY_CHANNELDOWN
config = Key Page_Down CurrentWindow
repeat = 1
end

Quote: this runs openbox, then irexec, then chromium browser, passing all the command line parameters to it.

You may want to run the compton cospositor too, it got rid of the tearing in fullscreen videos for me

Code:
export DISPLAY=:0
compton --backend glx --paint-on-overlay --glx-no-stencil --vsync opengl-swc --unredir-if-possible &

I also use xdotool to make crhomium go fullscreen at startup.

Code:
(sleep 5 && xdotool key F11)&

Oh and unclutter is good for hiding the mouse cursor after X seconds.

stealthdave72 Wrote:and I need to find a way to reliably find the main Chrome process instead.
Unfortunately the only way Ive found to do this (with linux anyway) is by using alt + f4, I never had much success with killing processes. If you do nut it out let us know about it!
Reply
#79
(2014-01-22, 07:21)stealthdave72 Wrote: Quick update: the good news is that my work-in-progress successfully captures the PID of the process that launches Chrome. The bad news is that the google-chrome launch application is more of a script that launches other processes, and I need to find a way to reliably find the main Chrome process instead.

i'm having a hard time figuring out what situation you'd need to kill the specific chrome instance rather than just killing all, especially if in XBMCbuntu.

can you elaborate?
Reply
#80
You're probably right, but the programmer in me finds it "sloppy" to just "killall". Wink Not to worry, though: I got it working! Big Grin You can test it from my GitHub repository here:

https://github.com/stealthdave/plugin.pr...e.launcher

Sorry; you'll need to install it manually for now. Once XBMC launches the Chrome browser, you can press "SELECT" from your web remote or your lirc remote for XBMC and it will kill the Chrome browser process that you opened. It works with the Amazon Chrome plugin and partially works with NetfliXBMC; the latter thinks that you're keeping streams open when you're not, so I need to figure out a way around that.

This has only been tested on Linux, but should work on OS X. It will probably not work on Windows because I have no Windows environment for testing, but there is stub code in there if anyone wants to take a look.

UPDATE: Chrome is now killed "gracefully" using SIGTERM instead of SIGKILL, which should prevent a number of issues including Chrome asking to restore previous sessions and Netfix giving you the dreaded N8008 error. (A fix for the latter if you've already got it can be found here.)
Reply
#81
I have XBMCbuntu and XMBC 12.3 installed. I installed this repo and I see that Chrome Launcher is enabled along with the Amazon plugin.

When I run the Amazon plugin and select a movie to play, I get an error saying that it cant find Chrome.

Any assistance?
Reply
#82
(2014-01-26, 01:00)vitalizm Wrote: I have XBMCbuntu and XMBC 12.3 installed. I installed this repo and I see that Chrome Launcher is enabled along with the Amazon plugin.

When I run the Amazon plugin and select a movie to play, I get an error saying that it cant find Chrome.

Any assistance?

you need to install chrome, or chromium.

go into the desktop environment and run synaptic.
Reply
#83
v1.0.8:
- Changed custom script handling (thx @ rob hodge)

It's no longer a pre-launch script, it executed instead of chrome and passes the parameters to it.
An example script is included. Copy it somewhere and make it executable...

(2014-01-08, 17:36)PaKman171175 Wrote: Apologies for a "newbie" question, but I've recently bought "The Little Black Box" as my introduction to XBMC and am very pleased with it. I've managed to install many "repos" and "addons" and also installed and configured "NetFliXBMC" and "Chrome" but it seems Chrome will not launch, no errors, no windows. I believe TLBB is a Linux install of XBMC although I'm not entirely sure, and if it is, it would seem I need to install Pipelight. However, the Pipelight instructions are command lines so I've no idea how I can install Pipelight onto TLBB.

Has anyone else managed to do this and able to help?

I notice from trawling the forum that TLBB is not exactly popular with experienced XBMC users and not sure if it's because it's a newish product or just not that good. I went for this because it came with and works with a fully working remote.

Thanks in advance
Sorry, but i guess pipelight won't run on TLBB...

(2014-01-09, 21:32)smallclone Wrote: Installed but I just get "chrome not found" when I try to run the vimeo or youtube links.
Set your chrome path...

(2014-01-10, 03:27)capomatt Wrote: Thanks for the great work on the add-on!
Things are kind of working for me but I'm having some issues with Chrome going full-screen. Running Win7 (64-bit) and when Chrome opens up, the taskbar is still visible. I can click the "fullscreen" button on the video and that takes care of things, but then I can't use Ctrl+W to close the window. I can use Alt+F4 to close the window but I have to do it twice - once to get the video out of fullscreen and again to close the window. This happens in both the Amazon Video and NetfliXBMC add-ons. Any ideas?
In the latest netflixbmc version, the pipelight fullscreen mode is used. If using the Control Utility, you can close it by just pressing one key.

(2014-01-11, 01:55)stealthdave72 Wrote: Small feature request: could you add the option to specify a user-agent for a given url and/or a custom parameters option? Ideally, we could have the following two options:
  • Use a pre-defined Windows user-agent string instead of system default (the same one you use for NetfliXBMC would be great)
  • Use custom parameters instead of Chrome Launcher defaults (covers all other options)

This could cover scenarios like Netflix where they sniff for OS or other information, or whatever we might need a custom launch option for.
Already implemented. But the custom User-Agent parameter is only used under Linux because it only makes sense there.
Maybe i will add some custom parameter stuff, but for now you'll need to edit the code.

(2014-01-15, 06:04)tobi1504 Wrote: Hi there,
somebody asked this question before, but i did not see an answer.
I get the error message "Chrome not found". I'm running XBMC on boxee box.

Can anybody help me to get this work?

Thanks
I guess Chrome is not available for boxee box.

(2014-01-16, 00:26)stealthdave72 Wrote: I've searched the thread here and in the NetfliXBMC/Amazon Prime plugin threads, but haven't been able to come up with an answer or solution to this particular issue:

Is it possible to close the Chrome browser via the Web Remote? Or better yet, map the Web Remote to specific keys so that we can control the page in the browser via the web remote?

The Web Remote is our only control mechanism for the two instances of XBMC in our home, and while the Chrome plugin definitely works well, it's impractical at best to open up a VNC connection to control it. Any thoughts on how this might be accomplished? I suspect it might need to happen at least partly at the plugin level.
Not yet, sorry. But i'll integrate some way to control it via web remote.

(2014-01-20, 07:37)rob hodge Wrote: There's also a second error In that script.

the last line should be:
Code:
kill %1
not
Code:
kill 1%

so, here is the script that will make it all fall into place on XBMCbuntu.

Code:
#!/bin/bash
openbox &
chromium-browser "$@"
kill %1

this should take care of it all.

in case i transposed something, this is the more hacked at version i am running right now, cut and pasted. it works perfectly on my system.
Code:
#!/bin/bash
openbox &
chromium-browser "$@" &
wait  %2
kill %1

functionally the same, but a bit more robust possibly.

now, can i ask for a boon? can the author put an option in the extensions properties to open just fullscreen instead of kiosk? i want to be able to get to the full interface, but to have it launch fullscreen without an address bar.

also, anyone hack in remote control support under XBMCbuntu?
Thanks! Smile I added your script as an example to the addon.
You can disable kiosk mode via the addon settings. But as far as i know, there is no parameter to start it in fullscreen mode. But maybe Chrome remembers it when you manually switch to fullscreen mode...

(2014-01-23, 01:09)stealthdave72 Wrote: You're probably right, but the programmer in me finds it "sloppy" to just "killall". Wink
In what situation are all chrome instances killed? Normally the user closes Chrome and it does not get killed...

(2014-01-23, 01:09)stealthdave72 Wrote: Not to worry, though: I got it working! Big Grin You can test it from my GitHub repository here:
I had a quick look at it - looks like a workaround because of the usage of the xbmc dialog. Wink
When i find some time i'll implement some more general way to get web remote working. With all usefull commands, not only closing chrome...
Reply
#84
Hello, I use Chrome Launcher with NetfliXBMC... everything was working great up until this new update that I recieved today.
Now Chrome Launcher addon fails everytime I try to launch NetfliXBMC.... Ive tried reinstalling bother addons but Chrome Launcher continues to fail...
Super frustrating because I don't understand why it was working fine and now it's dead.

Just looking for some advice, please let me know what more information you need to help me diagnose this problem

Thank You All Smile
Reply
#85
Same here, latest update throws a script error.
Reply
#86
(2014-01-26, 01:05)AddonScriptorDE Wrote:
(2014-01-23, 01:09)stealthdave72 Wrote: You're probably right, but the programmer in me finds it "sloppy" to just "killall". Wink
In what situation are all chrome instances killed? Normally the user closes Chrome and it does not get killed...

this was in reference to my workaround for IR remote. i didn't have an elegant way to grab the PID of the instance of chromium to close it with a kill command via an IR remote key press, so i mapped the 'stop' button to the command 'killall chromium-browser' stealthdave thought this was sloppy (and it is) but in a set top device installation it's got no drawbacks i can see.

of course, now that i think of it an alternative would be to cause that button to make xdotool pass a 'close window command to the window in the foreground. it has other drawbacks, but then again, i see no problems with using killall on my setup.

also, i've mapped the record button on my remote to a 'f' key press, so i can send it into fullscreen mode easily from the remote.
Reply
#87
v1.0.9:
- Removed old settings references

(2014-01-26, 02:28)xkalibr Wrote: Hello, I use Chrome Launcher with NetfliXBMC... everything was working great up until this new update that I recieved today.
Now Chrome Launcher addon fails everytime I try to launch NetfliXBMC.... Ive tried reinstalling bother addons but Chrome Launcher continues to fail...
Super frustrating because I don't understand why it was working fine and now it's dead.

Just looking for some advice, please let me know what more information you need to help me diagnose this problem

Thank You All Smile
(2014-01-26, 02:31)rushingjs Wrote: Same here, latest update throws a script error.
Is v1.0.9 now working again for you in combination with NetliXBMC v1.2.4 ? But i guess not.
Please upload your debug log...

(2014-01-26, 02:32)rob hodge Wrote: also, i've mapped the record button on my remote to a 'f' key press, so i can send it into fullscreen mode easily from the remote.
'f' is now automatically pressed in NetliXBMC v1.2.4 if xdotool is installed. Please let me know if this working for you...
Reply
#88
(2014-01-26, 01:02)rob hodge Wrote:
(2014-01-26, 01:00)vitalizm Wrote: I have XBMCbuntu and XMBC 12.3 installed. I installed this repo and I see that Chrome Launcher is enabled along with the Amazon plugin.

When I run the Amazon plugin and select a movie to play, I get an error saying that it cant find Chrome.

Any assistance?

you need to install chrome, or chromium.

go into the desktop environment and run synaptic.

Ok, I think I'm getting somewhere. I installed Chrome using wget https://dl.google.com/linux/direct/googl...t_i386.deb

Here is what I see now when I select a movie. I get a small chrome screen asking me to login but I cannot move my cursor to the Chrome screen.

What am I doing wrong?

Image
Reply
#89
(2014-01-26, 03:40)vitalizm Wrote: Ok, I think I'm getting somewhere. I installed Chrome using wget https://dl.google.com/linux/direct/googl...t_i386.deb

Here is what I see now when I select a movie. I get a small chrome screen asking me to login but I cannot move my cursor to the Chrome screen.

What am I doing wrong?
You need to have a desktop environment running. An example script to launch openbox (default on xbmcbuntu) is included in the addon folder.
Copy it somewhere and make it executable:
Code:
sudo chmod +x script.sh

See first and latest posts for more info...
Reply
#90
Thank You All Smile
[/quote]
(2014-01-26, 02:31)rushingjs Wrote: Same here, latest update throws a script error.
Is v1.0.9 now working again for you in combination with NetliXBMC v1.2.4 ? But i guess not.
Please upload your debug log...


hi
this is the error from / in the logfile

T:140320809416448 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.NameError'>
Error Contents: global name 'startScriptBefore' is not defined
Traceback (most recent call last):
File "/home/xbmc/.xbmc/addons/plugin.program.chrome.launcher/default.py", line 268, in <module>
showSite(url, stopPlayback, kiosk, userAgent)
File "/home/xbmc/.xbmc/addons/plugin.program.chrome.launcher/default.py", line 156, in showSite
if startScriptBefore and scriptPath:
NameError: global name 'startScriptBefore' is not defined
-->End of Python script error report<--
T:140322860672960 ERROR: GetDirectory - Error getting plugin://plugin.program.chrome.launcher/?kiosk=yes&mode=showSite&stopPlayback=yes&url=http%3a%2f%2fwww.vimeo.com%2fcouchmode
T:140322860672960 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.program.chrome.launcher/?kiosk=yes&mode=showSite&stopPlayback=yes&url=http%3a%2f%2fwww.vimeo.com%2fcouchmode) failed
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 47

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Chrome Launcher8