forked from platypush/platypush
[media.mpv] media.mpv.play should toggle pause when called with no resource.
This commit is contained in:
parent
c04aaba2bc
commit
1626fc737e
1 changed files with 5 additions and 1 deletions
|
@ -185,7 +185,7 @@ class MediaMpvPlugin(MediaPlugin):
|
||||||
@action
|
@action
|
||||||
def play(
|
def play(
|
||||||
self,
|
self,
|
||||||
resource: str,
|
resource: Optional[str] = None,
|
||||||
*_,
|
*_,
|
||||||
subtitles: Optional[str] = None,
|
subtitles: Optional[str] = None,
|
||||||
fullscreen: Optional[bool] = None,
|
fullscreen: Optional[bool] = None,
|
||||||
|
@ -211,6 +211,10 @@ class MediaMpvPlugin(MediaPlugin):
|
||||||
:param metadata: Optional metadata to attach to the resource.
|
:param metadata: Optional metadata to attach to the resource.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not resource:
|
||||||
|
self.pause()
|
||||||
|
return self.status()
|
||||||
|
|
||||||
self._post_event(MediaPlayRequestEvent, resource=resource)
|
self._post_event(MediaPlayRequestEvent, resource=resource)
|
||||||
if fullscreen is not None:
|
if fullscreen is not None:
|
||||||
args['fs'] = fullscreen
|
args['fs'] = fullscreen
|
||||||
|
|
Loading…
Reference in a new issue