From bb966f123ff0021909d0308b8d5e49a1cd71a5d1 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 13 Nov 2018 23:23:14 +0100 Subject: [PATCH] Added back and forward methods to Chromecast plugin --- platypush/plugins/media/chromecast.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platypush/plugins/media/chromecast.py b/platypush/plugins/media/chromecast.py index 25fb6df2..04dbe90c 100644 --- a/platypush/plugins/media/chromecast.py +++ b/platypush/plugins/media/chromecast.py @@ -212,6 +212,20 @@ class MediaChromecastPlugin(Plugin): 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 def is_playing(self, chromecast=None): return self.get_chromecast(chromecast or self.chromecast).media_controller.is_playing