Skip to content

Commit

Permalink
Reduce delay.
Browse files Browse the repository at this point in the history
According to
home-assistant/core#16319 this
commit should help with delay. It helped me to go from 17 seconds to
3 seconds delay when using chromecast. Related to #221, #61 and
  probably #104.
  • Loading branch information
muammar committed Apr 7, 2019
1 parent eff4c7e commit b6d0b3b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mkchromecast/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ def play_cast(self):
media_controller.play_media(
self.source_url,
mtype,
title=self.title
title=self.title,
stream_type='LIVE'
)
media_controller.play()
elif (self.backend == 'ffmpeg' or self.backend == 'node' or
self.backend == 'avconv' or self.backend == 'parec' or
self.backend == 'gstreamer' and self.source_url is None):
Expand All @@ -331,8 +333,13 @@ def play_cast(self):
media_controller.play_media(
'http://' + localip + ':' + self.port + '/stream',
mtype,
title=self.title
title=self.title,
stream_type='LIVE'
)
if media_controller.is_active:
import time
time.sleep(2)
media_controller.play()
print(' ')
print(colors.important('Cast media controller status'))
print(' ')
Expand Down

0 comments on commit b6d0b3b

Please sign in to comment.