mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Fix live tv
For now, use transcode since direct play returns a 127.0.0.1 unusable address as the path.
This commit is contained in:
parent
883c1741bf
commit
ad6aa7e448
1 changed files with 14 additions and 6 deletions
|
@ -181,8 +181,13 @@ class PlayUtils(object):
|
||||||
'''
|
'''
|
||||||
self.info['MediaSourceId'] = source['Id']
|
self.info['MediaSourceId'] = source['Id']
|
||||||
|
|
||||||
if source['RequiresOpening']:
|
if source.get('RequiresClosing'):
|
||||||
source = self.live_stream(source)
|
''' Server is returning live tv stream with hardcoded 127.0.0.1. Skip over direct play/stream until fixed.
|
||||||
|
'''
|
||||||
|
self.info['LiveStreamId'] = source['LiveStreamId']
|
||||||
|
source['SupportsDirectPlay'] = False
|
||||||
|
source['SupportsDirectStream'] = False
|
||||||
|
source['Protocol'] = "LiveTV"
|
||||||
|
|
||||||
if source.get('Protocol') == 'Http' or source['SupportsDirectPlay'] and (self.is_strm(source) or not settings('playFromStream.bool') and self.is_file_exists(source)):
|
if source.get('Protocol') == 'Http' or source['SupportsDirectPlay'] and (self.is_strm(source) or not settings('playFromStream.bool') and self.is_file_exists(source)):
|
||||||
|
|
||||||
|
@ -220,7 +225,7 @@ class PlayUtils(object):
|
||||||
LOG.info(info)
|
LOG.info(info)
|
||||||
|
|
||||||
if info['MediaSource'].get('RequiresClosing'):
|
if info['MediaSource'].get('RequiresClosing'):
|
||||||
self.info['LiveStreamId'] = info['MediaSource']['LiveStreamId']
|
self.info['LiveStreamId'] = source['LiveStreamId']
|
||||||
|
|
||||||
return info['MediaSource']
|
return info['MediaSource']
|
||||||
|
|
||||||
|
@ -243,8 +248,9 @@ class PlayUtils(object):
|
||||||
|
|
||||||
params = "%s%s" % ('&'.join(url_parsed), self.get_audio_subs(source, audio, subtitle))
|
params = "%s%s" % ('&'.join(url_parsed), self.get_audio_subs(source, audio, subtitle))
|
||||||
|
|
||||||
video_type = 'live' if source.get('LiveStreamId') else 'master'
|
video_type = 'live' if source['Protocol'] == 'LiveTV' else 'master'
|
||||||
self.info['Path'] = "%s/emby%s?%s" % (self.info['ServerAddress'], base.replace('stream', video_type), params)
|
base = base.replace('stream' if 'stream' in base else 'master', video_type, 1)
|
||||||
|
self.info['Path'] = "%s/emby%s?%s" % (self.info['ServerAddress'], base, params)
|
||||||
self.info['Path'] += "&maxWidth=%s&maxHeight=%s" % (self.get_resolution())
|
self.info['Path'] += "&maxWidth=%s&maxHeight=%s" % (self.get_resolution())
|
||||||
else:
|
else:
|
||||||
self.info['Path'] = "%s/emby%s" % (self.info['ServerAddress'], source['TranscodingUrl'])
|
self.info['Path'] = "%s/emby%s" % (self.info['ServerAddress'], source['TranscodingUrl'])
|
||||||
|
@ -421,7 +427,7 @@ class PlayUtils(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.info['ForceTranscode']:
|
if self.info['ForceTranscode']:
|
||||||
profile['DirectPlayProfiles'] = [{}]
|
profile['DirectPlayProfiles'] = []
|
||||||
|
|
||||||
if self.item['Type'] == 'TvChannel':
|
if self.item['Type'] == 'TvChannel':
|
||||||
profile['TranscodingProfiles'].insert(0, {
|
profile['TranscodingProfiles'].insert(0, {
|
||||||
|
@ -436,6 +442,8 @@ class PlayUtils(object):
|
||||||
"BreakOnNonKeyFrames": True
|
"BreakOnNonKeyFrames": True
|
||||||
})
|
})
|
||||||
|
|
||||||
|
profile['DirectPlayProfiles'] = []
|
||||||
|
|
||||||
return profile
|
return profile
|
||||||
|
|
||||||
def set_external_subs(self, source, listitem):
|
def set_external_subs(self, source, listitem):
|
||||||
|
|
Loading…
Reference in a new issue