2018-04-19 22:42:28 +02:00
|
|
|
from platypush.message.event import Event
|
|
|
|
|
|
|
|
|
|
|
|
class VideoEvent(Event):
|
2018-04-19 22:45:40 +02:00
|
|
|
""" Base class for video events """
|
2018-04-19 22:42:28 +02:00
|
|
|
|
2018-04-25 01:04:51 +02:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
2018-04-19 22:42:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
class VideoPlayEvent(VideoEvent):
|
2018-07-09 22:37:54 +02:00
|
|
|
"""
|
|
|
|
Event triggered when a new video content is played
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, video=None, *args, **kwargs):
|
|
|
|
"""
|
|
|
|
:param video: File name or URI of the played video
|
|
|
|
:type video: str
|
|
|
|
"""
|
|
|
|
|
|
|
|
super().__init__(*args, video=video, **kwargs)
|
2018-04-19 22:42:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
class VideoStopEvent(VideoEvent):
|
2018-07-09 22:37:54 +02:00
|
|
|
"""
|
|
|
|
Event triggered when a video is stopped
|
|
|
|
"""
|
|
|
|
|
2018-04-19 22:42:28 +02:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
class VideoPauseEvent(VideoEvent):
|
2018-07-09 22:37:54 +02:00
|
|
|
"""
|
|
|
|
Event triggered when a video playback is paused
|
|
|
|
"""
|
|
|
|
|
2018-04-19 22:42:28 +02:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
class NewPlayingVideoEvent(VideoEvent):
|
2018-07-09 22:37:54 +02:00
|
|
|
"""
|
|
|
|
Event triggered when a video playback is paused
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, video=None, *args, **kwargs):
|
|
|
|
"""
|
|
|
|
:param video: File name or URI of the played video
|
|
|
|
:type video: str
|
|
|
|
"""
|
|
|
|
|
|
|
|
super().__init__(*args, video=video, **kwargs)
|
2018-04-19 22:42:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
# vim:sw=4:ts=4:et:
|
|
|
|
|