forked from platypush/platypush
Added back and forward methods to Chromecast plugin
This commit is contained in:
parent
025309cae8
commit
bb966f123f
1 changed files with 14 additions and 0 deletions
|
@ -212,6 +212,20 @@ class MediaChromecastPlugin(Plugin):
|
||||||
return self.get_chromecast(chromecast or self.chromecast).media_controller.seek(location)
|
return self.get_chromecast(chromecast or self.chromecast).media_controller.seek(location)
|
||||||
|
|
||||||
|
|
||||||
|
@action
|
||||||
|
def back(self, chromecast=None, delta=30):
|
||||||
|
mc = self.get_chromecast(chromecast or self.chromecast).media_controller
|
||||||
|
if mc.status.current_time:
|
||||||
|
return mc.seek(mc.status.current_time-delta)
|
||||||
|
|
||||||
|
|
||||||
|
@action
|
||||||
|
def forward(self, chromecast=None, delta=30):
|
||||||
|
mc = self.get_chromecast(chromecast or self.chromecast).media_controller
|
||||||
|
if mc.status.current_time:
|
||||||
|
return mc.seek(mc.status.current_time+delta)
|
||||||
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def is_playing(self, chromecast=None):
|
def is_playing(self, chromecast=None):
|
||||||
return self.get_chromecast(chromecast or self.chromecast).media_controller.is_playing
|
return self.get_chromecast(chromecast or self.chromecast).media_controller.is_playing
|
||||||
|
|
Loading…
Reference in a new issue