Correctly stop transcoding

This commit is contained in:
tomkat83 2016-04-13 16:14:55 +02:00
parent e5e70f769e
commit a089dc6e04
2 changed files with 9 additions and 10 deletions

View file

@ -1899,15 +1899,14 @@ class API():
url += '?' + urlencode(xargs)
return url
# For Direct Streaming or Transcoding
from uuid import uuid4
# For Transcoding
# Path/key to VIDEO item of xml PMS response is needed, not part
path = self.item.attrib['key']
transcodePath = self.server + \
'/video/:/transcode/universal/start.m3u8?'
args = {
'protocol': 'hls', # seen in the wild: 'dash', 'http', 'hls'
'session': str(uuid4()),
'session': clientinfo.ClientInfo().getDeviceId(),
'fastSeek': 1,
'path': path,
'mediaIndex': 0, # Probably refering to XML reply sheme

View file

@ -545,10 +545,10 @@ class Player(xbmc.Player):
# Stop transcoding
if playMethod == "Transcode":
log("Transcoding for %s terminated." % itemid, 1)
deviceId = self.clientInfo.getDeviceId()
url = "{server}/emby/Videos/ActiveEncodings?DeviceId=%s" % deviceId
doUtils(url, type="DELETE")
log("Transcoding for %s terminating" % itemid, 1)
doUtils(
"{server}/video/:/transcode/universal/stop",
parameters={'session': self.clientInfo.getDeviceId()})
self.played_info.clear()