Skip to content

Commit

Permalink
fix: Speed up casting by not killing apps known to be nonblocking
Browse files Browse the repository at this point in the history
Merge pull request skorokithakis#3 from theychx/speed-up-cast
  • Loading branch information
skorokithakis authored Aug 17, 2016
2 parents 416f3e4 + 57090d8 commit a039617
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions catt/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ def __init__(self):
time.sleep(0.2)

def play_media(self, url, content_type="video/mp4"):
self.kill()
time.sleep(5)
NON_BLOCKING_APPS = ['Backdrop', 'Default Media Receiver',
'BubbleUPnP']
if self.cast.app_display_name not in NON_BLOCKING_APPS:
self.kill()
while self.cast.app_display_name != 'Backdrop':
time.sleep(1)
self.cast.play_media(url, content_type)

def play(self):
Expand Down

0 comments on commit a039617

Please sign in to comment.