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

View file

@ -150,6 +150,10 @@ class MediaPlugin(Plugin):
def stop(self, *args, **kwargs): def stop(self, *args, **kwargs):
raise self._NOT_IMPLEMENTED_ERR raise self._NOT_IMPLEMENTED_ERR
@action
def quit(self, *args, **kwargs):
raise self._NOT_IMPLEMENTED_ERR
@action @action
def voldown(self, *args, **kwargs): def voldown(self, *args, **kwargs):
raise self._NOT_IMPLEMENTED_ERR raise self._NOT_IMPLEMENTED_ERR

View file

@ -79,6 +79,14 @@ class MediaOmxplayerPlugin(MediaPlugin):
@action @action
def stop(self): def stop(self):
""" Stop the playback """ """ Stop the playback """
if self._player:
self._player.stop()
return {'status':'stop'}
@action
def quit(self):
""" Quit the player """
if self._player: if self._player:
self._player.stop() self._player.stop()
self._player.quit() self._player.quit()
@ -86,6 +94,7 @@ class MediaOmxplayerPlugin(MediaPlugin):
return {'status':'stop'} return {'status':'stop'}
@action @action
def voldown(self): def voldown(self):
""" Volume down by 10% """ """ Volume down by 10% """