Release Banners - (Display ad-banners over full screen video)
#80
OK, came up with something like this, just in case Smile

Code:
    def _get_skin_resolution(self):
        aspect_ratio = xbmc.getInfoLabel('Skin.AspectRatio')

        xmlFile = os.path.join(xbmc.translatePath("special://skin/"), "addon.xml")

        with open(xmlFile) as f:
            xml_file = f.read()

        res_extension_point = common.parseDOM(xml_file, 'extension', attrs={'point': 'xbmc.gui.skin'})[0]
        res_lines = res_extension_point.splitlines()

        try:
            skin_resolution = [res for res in res_lines if aspect_ratio in res][0]
        except IndexError:
            xmldoc = minidom.parse(xmlFile)
            res = xmldoc.getElementsByTagName("res")
            xval = int(res[0].attributes["width"].value)
            yval = int(res[0].attributes["height"].value)
        else:
            xval = int(re.findall('width="(\d{3,4})"', skin_resolution)[0])
            yval = int(re.findall('height="(\d{3,4})"', skin_resolution)[0])

        return xval, yval
Reply


Messages In This Thread
RE: Banners - by misa - 2016-11-28, 12:18
RE: Banners - by docwra - 2016-11-28, 12:27
RE: Banners - by DjBeNI - 2016-11-28, 14:02
RE: Banners - by User 325245 - 2016-11-28, 15:09
RE: Banners - by DjBeNI - 2016-11-28, 18:27
RE: Banners - by User 325245 - 2016-11-28, 20:13
RE: Banners - by DjBeNI - 2016-11-28, 22:07
RE: Banners - by User 325245 - 2016-11-28, 22:47
RE: Banners - by DjBeNI - 2016-11-28, 23:30
RE: Banners - by User 325245 - 2016-11-29, 00:04
RE: Banners - by User 325245 - 2016-11-29, 11:50
RE: Banners - by User 325245 - 2016-11-30, 11:08
RE: Banners - by misa - 2016-12-06, 17:16
RE: Banners - by User 325245 - 2016-12-06, 19:24
RE: Banners - by misa - 2016-12-06, 20:46
RE: Banners - by User 325245 - 2016-12-06, 22:20
RE: Banners - by User 325245 - 2016-12-07, 09:43
RE: Banners - by misa - 2016-12-07, 10:14
RE: Banners - by User 325245 - 2016-12-09, 15:10
RE: Banners - by User 325245 - 2016-12-11, 01:59
RE: Banners - (Display ad-banners over full screen video) - by User 325245 - 2018-01-09, 21:42
Logout Mark Read Team Forum Stats Members Help
Banners - (Display ad-banners over full screen video)1