mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-12 21:26:10 +00:00
Use TranscodingUrl if available
This commit is contained in:
parent
d402e3d0dd
commit
c37652ccd7
1 changed files with 18 additions and 10 deletions
|
@ -146,7 +146,7 @@ class PlayUtils():
|
||||||
else:
|
else:
|
||||||
source['Path'] = self.get_http_path(source, True if not source['SupportsDirectStream'] else self.force_transcode)
|
source['Path'] = self.get_http_path(source, True if not source['SupportsDirectStream'] else self.force_transcode)
|
||||||
|
|
||||||
log.debug('get source: %s', source)
|
log.debug("get source: %s", source)
|
||||||
return source
|
return source
|
||||||
|
|
||||||
def is_file_exists(self, source):
|
def is_file_exists(self, source):
|
||||||
|
@ -271,15 +271,23 @@ class PlayUtils():
|
||||||
|
|
||||||
self.method = "Transcode"
|
self.method = "Transcode"
|
||||||
|
|
||||||
item_id = self.item['Id']
|
if 'TranscodingUrl' in source:
|
||||||
url = urllib_path("%s/emby/Videos/%s/master.m3u8" % (self.server, item_id), {
|
base, params = source['TranscodingUrl'].split("?")
|
||||||
|
url_parsed = params.split("&")
|
||||||
|
for i in url_parsed:
|
||||||
|
if 'AudioStreamIndex' in i or 'AudioBitrate' in i: #handle manually
|
||||||
|
url_parsed.remove(i)
|
||||||
|
url = "%s/emby%s?%s" % (self.server, base.replace("stream", "master"), '&'.join(url_parsed))
|
||||||
|
else:
|
||||||
|
item_id = self.item['Id']
|
||||||
|
url = urllib_path("%s/emby/Videos/%s/master.m3u8" % (self.server, item_id), {
|
||||||
|
|
||||||
'VideoCodec': "h264",
|
'VideoCodec': "h264",
|
||||||
'AudioCodec': "ac3",
|
'AudioCodec': "ac3",
|
||||||
'MaxAudioChannels': 6,
|
'MaxAudioChannels': 6,
|
||||||
'DeviceId': self.clientInfo.get_device_id(),
|
'DeviceId': self.clientInfo.get_device_id(),
|
||||||
'VideoBitrate': self.get_bitrate() * 1000
|
'VideoBitrate': self.get_bitrate() * 1000
|
||||||
})
|
})
|
||||||
|
|
||||||
# Select audio and subtitles
|
# Select audio and subtitles
|
||||||
url += self.get_audio_subs(source)
|
url += self.get_audio_subs(source)
|
||||||
|
@ -528,7 +536,7 @@ class PlayUtils():
|
||||||
"Type": 0
|
"Type": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Container": "ts",
|
"Container": "m3u8",
|
||||||
"AudioCodec": "ac3",
|
"AudioCodec": "ac3",
|
||||||
"VideoCodec": "h264",
|
"VideoCodec": "h264",
|
||||||
"Type": 1
|
"Type": 1
|
||||||
|
|
Loading…
Reference in a new issue