Release Banners - (Display ad-banners over full screen video) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152) +---- Thread: Release Banners - (Display ad-banners over full screen video) (/showthread.php?tid=298093) |
RE: Banners - (Display ad-banners over full screen video) - twilight0 - 2018-01-09 So I updated the code to something like this: Code: def _get_skin_resolution(self): Its using parsedom instead of minidom and regex pattern. It has been tested. RE: Banners - (Display ad-banners over full screen video) - User 325245 - 2018-01-09 Nice, I'll test it. From what I've read, Kodi tries to find closest resolution in the skin, if it is not there, it uses next lower one. This gets the first resolution with corresponding aspect ratio? RE: Banners - (Display ad-banners over full screen video) - twilight0 - 2018-01-09 (2018-01-09, 20:10)DaLanik Wrote: Nice, I'll test it. From what I've read, Kodi tries to find closest resolution in the skin, if it is not there, it uses next lower one.Yes and no. Yes because it gets current used aspect ratio and finds matching resolution from a skin. No because the code will probably need a fallback in case there is no match, a rare occasion but can happen at some setups, especially on raspberry pis with CRT monitors. RE: Banners - (Display ad-banners over full screen video) - User 325245 - 2018-01-09 Hmm, thinking of it, aspect_ratio = xbmc.getInfoLabel('Skin.AspectRatio') gets SKIN a/r... so it must be something from the skin's addon.xml file? Then there MUST be a match in listed resolutions... RE: Banners - (Display ad-banners over full screen video) - User 325245 - 2018-01-09 OK, came up with something like this, just in case Code: def _get_skin_resolution(self): RE: Banners - (Display ad-banners over full screen video) - twilight0 - 2018-01-09 (2018-01-09, 21:18)DaLanik Wrote: Hmm, thinking of it, aspect_ratio = xbmc.getInfoLabel('Skin.AspectRatio') gets SKIN a/r... so it must be something from the skin's addon.xml file? Then there MUST be a match in listed resolutions...It gets current resolution used, not the skin's. Kodi uses an aspect ratio that suits for current surface and if there is no matching one, the closest one is used. Estuary has most common aspect ratios, while confluence has just one. IMHO this is a lot simpler, without the additional overhead of handling an exception, adding just an else into the list comprehension: Code: def _get_skin_resolution(self): RE: Banners - (Display ad-banners over full screen video) - twilight0 - 2018-01-10 I took the liberty and forked your addon because I desperately needed a few changes asap. https://github.com/Twilight0/service.banners.mod It also looks like PIL doesn't like indexed pngs. RE: Banners - (Display ad-banners over full screen video) - User 325245 - 2018-01-10 (2018-01-09, 22:10)twilight0 Wrote:This crashes... RE: Banners - (Display ad-banners over full screen video) - twilight0 - 2018-01-10 (2018-01-10, 11:42)DaLanik Wrote:Provide your log so we can sort it out. Also, which skin your using, kodi version, your aspect radio and finally screen resolution.(2018-01-09, 22:10)twilight0 Wrote:This crashes... RE: Banners - (Display ad-banners over full screen video) - DoubleT - 2018-01-15 Hi DaLanik, i've been looking around your code trying to get my head around it to make a few changes for a local project i'm working on for a non-profit. Im trying to make the banner display cover the entire width of the screen, and be a bit taller, touching the bottom of the display. I've found where the overlay class is created but can't work out how the height and width is written - especially when called via JSON rather than a rotation. Would you be able to point me at some line numbers? RE: Banners - (Display ad-banners over full screen video) - User 325245 - 2018-01-15 Ugh, been awhile since I delved into code there The function is scaleimage(self, width, height, yoffset) RE: Banners - (Display ad-banners over full screen video) - DoubleT - 2018-01-15 Thanks man, it's a bit over my head atm (im still new to python) but hopefully will make some progress with a friend tomorrow RE: Banners - (Display ad-banners over full screen video) - User 325245 - 2018-01-16 I think it should be enough to set width to viewport_w (that's the width of the screen), but then you have to calculate height to be proportional to width... RE: Banners - (Display ad-banners over full screen video) - DoubleT - 2018-01-16 Much appreciated, have managed to get an MVP going by increasing image size and setting image bottom to bottom of the viewport. Will throw over a donation at the end of the month RE: Banners - (Display ad-banners over full screen video) - User 325245 - 2018-06-15 v2.0 - Language file format related changes |