From 918ab0bdd0a828c87233129069302199a886f805 Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Fri, 14 Feb 2014 21:37:33 +0200 Subject: [PATCH 1/3] Fix not looping issue in uix/video.py --- kivy/uix/video.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kivy/uix/video.py b/kivy/uix/video.py index 65ce6b956..c258b06c2 100644 --- a/kivy/uix/video.py +++ b/kivy/uix/video.py @@ -132,6 +132,8 @@ class Video(Image): super(Image, self).__init__(**kwargs) self.bind(source=self._trigger_video_load) + if "eos" in kwargs: + self.options["eos"] = kwargs["eos"] if self.source: self._trigger_video_load() From 810a149511274a95a59bc1297efd271bbde76837 Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Sat, 15 Feb 2014 00:59:57 +0200 Subject: [PATCH 2/3] Added appropriate documentaion for eos --- kivy/uix/videoplayer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kivy/uix/videoplayer.py b/kivy/uix/videoplayer.py index aae0480b1..5d0f8e6a0 100644 --- a/kivy/uix/videoplayer.py +++ b/kivy/uix/videoplayer.py @@ -55,6 +55,17 @@ You can allow stretching by passing custom options to a player = VideoPlayer(source='myvideo.avi', state='play', options={'allow_stretch': True}) +Looping +------- + +You can also loop the video by passing an *eos* (end of stream) directive to +the underlying :class:`~kivy.core.video.VideoBase` class. Note that +this *eos* property is a string and not a boolean, like the +:class:`VideoPlayer` and :class:`~kivy.uix.videoplayer.VideoPlayer` classes:: + + player = VideoPlayer(source='myvideo.avi', state='play', + options={'eos': 'loop'}) + ''' __all__ = ('VideoPlayer', 'VideoPlayerAnnotation') From 220fc571a5cbf9e8146ceb339bfb0c4c7b228c36 Mon Sep 17 00:00:00 2001 From: Zen-CODE Date: Sun, 16 Feb 2014 21:52:47 +0200 Subject: [PATCH 3/3] Ammeded the docs for more accurate summary --- kivy/uix/videoplayer.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/kivy/uix/videoplayer.py b/kivy/uix/videoplayer.py index 5d0f8e6a0..351c4137a 100644 --- a/kivy/uix/videoplayer.py +++ b/kivy/uix/videoplayer.py @@ -55,17 +55,26 @@ You can allow stretching by passing custom options to a player = VideoPlayer(source='myvideo.avi', state='play', options={'allow_stretch': True}) -Looping -------- +End-of-stream behavior +---------------------- -You can also loop the video by passing an *eos* (end of stream) directive to -the underlying :class:`~kivy.core.video.VideoBase` class. Note that -this *eos* property is a string and not a boolean, like the -:class:`VideoPlayer` and :class:`~kivy.uix.videoplayer.VideoPlayer` classes:: +You can specify what happens when the video has finished playing by passing an +*eos* (end of stream) directive to the underlying +:class:`~kivy.core.video.VideoBase` class. *eos* can be one of 'stop', 'pause' +or 'loop' and defaults to 'stop'. For example, in order to loop the video:: player = VideoPlayer(source='myvideo.avi', state='play', options={'eos': 'loop'}) +.. note:: + + The *eos* property of the VideoBase class is a string specifying the + end-of-stream behavior. This property differs from the *eos* + properties of the :class:`VideoPlayer` and + :class:`~kivy.uix.video.Video` classes, whose *eos* + property is simply a boolean indicating that the end of the file has + been reached. + ''' __all__ = ('VideoPlayer', 'VideoPlayerAnnotation')