|
4 | 4 | from __future__ import absolute_import, division, unicode_literals |
5 | 5 |
|
6 | 6 | import logging |
7 | | - |
8 | 7 | import xbmc |
9 | 8 | import xbmcaddon |
10 | 9 | import xbmcgui |
@@ -118,7 +117,7 @@ def url_for(name, *args, **kwargs): |
118 | 117 |
|
119 | 118 |
|
120 | 119 | def show_listing(title_items, category=None, sort=None, content=None, cache=True): |
121 | | - """ Show a virtual directory in Kodi """ |
| 120 | + """Show a virtual directory in Kodi""" |
122 | 121 | from resources.lib.addon import routing |
123 | 122 |
|
124 | 123 | if content: |
@@ -200,11 +199,20 @@ def play(stream, title=None, art_dict=None, info_dict=None, prop_dict=None): |
200 | 199 | if prop_dict: |
201 | 200 | play_item.setProperties(prop_dict) |
202 | 201 |
|
| 202 | + # Setup Inputstream Adaptive |
| 203 | + if kodi_version_major() >= 19: |
| 204 | + play_item.setProperty('inputstream', 'inputstream.adaptive') |
| 205 | + else: |
| 206 | + play_item.setProperty('inputstreamaddon', 'inputstream.adaptive') |
| 207 | + play_item.setProperty('inputstream.adaptive.manifest_type', 'hls') |
| 208 | + play_item.setMimeType('application/vnd.apple.mpegurl') |
| 209 | + play_item.setContentLookup(False) |
| 210 | + |
203 | 211 | xbmcplugin.setResolvedUrl(routing.handle, True, listitem=play_item) |
204 | 212 |
|
205 | 213 |
|
206 | 214 | def get_search_string(heading='', message=''): |
207 | | - """ Ask the user for a search string """ |
| 215 | + """Ask the user for a search string""" |
208 | 216 | search_string = None |
209 | 217 | keyboard = xbmc.Keyboard(message, heading) |
210 | 218 | keyboard.doModal() |
@@ -265,15 +273,15 @@ def create(self, heading, message=''): # pylint: disable=arguments-differ |
265 | 273 | """Create and show a progress dialog""" |
266 | 274 | if kodi_version_major() < 19: |
267 | 275 | lines = message.split('\n', 2) |
268 | | - line1, line2, line3 = (lines + [None] * (3-len(lines))) |
| 276 | + line1, line2, line3 = (lines + [None] * (3 - len(lines))) |
269 | 277 | return super(progress, self).create(heading, line1=line1, line2=line2, line3=line3) |
270 | 278 | return super(progress, self).create(heading, message=message) |
271 | 279 |
|
272 | 280 | def update(self, percent, message=''): # pylint: disable=arguments-differ |
273 | 281 | """Update the progress dialog""" |
274 | 282 | if kodi_version_major() < 19: |
275 | 283 | lines = message.split('\n', 2) |
276 | | - line1, line2, line3 = (lines + [None] * (3-len(lines))) |
| 284 | + line1, line2, line3 = (lines + [None] * (3 - len(lines))) |
277 | 285 | return super(progress, self).update(percent, line1=line1, line2=line2, line3=line3) |
278 | 286 | return super(progress, self).update(percent, message=message) |
279 | 287 |
|
|
0 commit comments