Added back and forward methods to Chromecast plugin

This commit is contained in:
Fabio Manganiello 2018-11-13 23:23:14 +01:00
parent 025309cae8
commit bb966f123f

View file

@ -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