Covering up Full Screen Video
#1
I have been working on a small (seemingly simple) script, and running into a lot of issues.
My motivation is that I watch a lot of sporting events (specifically US Football) which scroll scores of other games along the bottom of the screen. I do not want to see this, since it spoils my ability to watch those games at a later time. I'm trying to write a addon which covers up a small area of the bottom of the full screen video window (window ID 12005).

What I've done so far:
- got a handle to the window using 'win = xbmcgui.Window(12005)'
- Added a imageControl to it using 'win.addContro()l'.

This works (kind of), but has a lot of issues. The ones I'm aware of:
1. This is modifying an existing window, which seems like a bad idea. I'd rather place a new window/dialog in front of the existing one - but I couldn't see how to do that.
2. The size/resolution of the Full Screen Video window changes from time to time. When my script runs, the height of the FSV window is 720 pixels - but when I go to watch TV via my tuner card, it changes to 1080 pixels. This sucks because when I run my script it calculates where the overlay image should go based on the wrong resolution - and it ends up in the wrong place.
3. Ideally, this overlay control could be shown/hidden interactively via a keypress. I can't see a way of doing that without interfering with the video playback window's ability to process keys. It would also require this addon to be running in the background all the time - I suppose that means calling sleep() constantly?

Based on the issues I've run into, it feels like I'm going about the problem wrong. Anyone have suggestions for interactively putting on overlay over the fullscreen video window? It almost seems like this kind of customization isn't possible without modifying the skin. My code is below in case anyone would like to see it.

Code:
WINDOW_FULLSCREEN_VIDEO = 12005
__addonpath__       = xbmc.translatePath(__addon__.getAddonInfo('path')).decode('utf-8')

self.window = xbmcgui.Window(WINDOW_FULLSCREEN_VIDEO)
self.strTest = xbmcgui.ControlImage(0, self.window.getHeight()*0.9, self.window.getWidth(), self.window.getHeight()*0.1, __addonpath__+ '/resources/foo.png',colorDiffuse='0xFF000000' )
self.window.addControl(self.strTest)
Reply
#2
(2013-10-21, 23:35)teaguecl Wrote: 1. This is modifying an existing window, which seems like a bad idea. I'd rather place a new window/dialog in front of the existing one - but I couldn't see how to do that.

Use WindowDialog class. It creates a transparent overlay over XBMC GUI which stays on top until close() method is called. And then you can place your controls over it.

Quote:2. The size/resolution of the Full Screen Video window changes from time to time. When my script runs, the height of the FSV window is 720 pixels - but when I go to watch TV via my tuner card, it changes to 1080 pixels. This sucks because when I run my script it calculates where the overlay image should go based on the wrong resolution - and it ends up in the wrong place.

This should be written somewhere in documentation in bold red letters: never ever use elf.window.getWidth() and self.window.getHeight() to determine the size of your controls, because GUI coordinate grid resolution is always the same - 1280x720 by default.

Quote:3. Ideally, this overlay control could be shown/hidden interactively via a keypress. I can't see a way of doing that without interfering with the video playback window's ability to process keys. It would also require this addon to be running in the background all the time - I suppose that means calling sleep() constantly?

You can simply bind it to a key action in keyboard.xml, e.g.:
Code:
<b>RunScript(your.script)</b>
And any keys that are not used to control video playback can be used to control your add-on.
Reply
#3
Thank you Roman for the hints, especially regarding the GUI coordinate resolution. I decided (based on lack of interest in this thread) not to make it too fancy. I stuck with modifying the existing FS Video Window. The whole script is only about 20 lines, and it works exactly the way I want it to. It's probably not very flexible for other peoples needs - but it seemed like nobody else needed it. Below is a link to my code, in case anyone would like to see it.
https://dl.dropboxusercontent.com/u/4770...locker.zip
Reply

Logout Mark Read Team Forum Stats Members Help
Covering up Full Screen Video0