From c18650c964b5a9f05f7c67a69cd4615790b14e89 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 2 Feb 2019 17:12:20 +0100 Subject: [PATCH] quit method implemented as part of the media interface --- platypush/plugins/media/__init__.py | 4 ++++ platypush/plugins/media/omxplayer.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/platypush/plugins/media/__init__.py b/platypush/plugins/media/__init__.py index 0d869f7058..5598c3b053 100644 --- a/platypush/plugins/media/__init__.py +++ b/platypush/plugins/media/__init__.py @@ -150,6 +150,10 @@ class MediaPlugin(Plugin): def stop(self, *args, **kwargs): raise self._NOT_IMPLEMENTED_ERR + @action + def quit(self, *args, **kwargs): + raise self._NOT_IMPLEMENTED_ERR + @action def voldown(self, *args, **kwargs): raise self._NOT_IMPLEMENTED_ERR diff --git a/platypush/plugins/media/omxplayer.py b/platypush/plugins/media/omxplayer.py index b3aa83e9d0..ae50d062b1 100644 --- a/platypush/plugins/media/omxplayer.py +++ b/platypush/plugins/media/omxplayer.py @@ -79,6 +79,14 @@ class MediaOmxplayerPlugin(MediaPlugin): @action def stop(self): """ Stop the playback """ + if self._player: + self._player.stop() + + return {'status':'stop'} + + @action + def quit(self): + """ Quit the player """ if self._player: self._player.stop() self._player.quit() @@ -86,6 +94,7 @@ class MediaOmxplayerPlugin(MediaPlugin): return {'status':'stop'} + @action def voldown(self): """ Volume down by 10% """