quit method implemented as part of the media interface

This commit is contained in:
Fabio Manganiello 2019-02-02 17:12:20 +01:00
parent ed4b7e1da9
commit c18650c964
2 changed files with 13 additions and 0 deletions
platypush/plugins/media

View file

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

View file

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