Repository: kivy/kivy

Issue:
Video loop does not work
<!--
The issue tracker is a tool to address bugs.
Please use the #kivy IRC channel on freenode or Stack Overflow for
support questions, more information at https://git.io/vM1yQ.

Before opening a new issue, make sure you do the following:
    * check that your issue isn't already filed: https://git.io/vM1iE
    * prepare a short, runnable example that reproduces the issue
    * reproduce the problem with the latest development version of Kivy
    * double-check that the issue is indeed a bug and not a support request
-->

### Versions

* Python: 3.5.3
* OS: Raspbian GNU/Linux 9.4 (stretch)
* Kivy: git-bf8869f, 20180726
* Kivy installation method: from source, clone and python setup.py

### Description

I'm using the Video widget to display a video on loop on a Raspberry Pi. The method I used earlier worked perfectly well. I made some unrelated changes to my software and the current version stops on eos instead of looping around. Kivy version was not changed. The code works perfectly fine on regular linux with the same kivy version, though other dependencies and python version might be slightly different. 

I know it's a development version and things might not work as expected, but I require some feature that was 1.10+ (I don't remember which). I have a functioning workaround so it's not critical to me at the moment, but a pointer to where to look to debug this problem and figure out where it came from would help.

### Code and Logs

The code below works as expected. `_when_done()` is called, it restarts the video.

```python

bg_video = Video(
    source=value, state='play',
    allow_stretch=True, # eos='loop'
)

def _when_done(*_):
    _bg_video.state = 'play'
_bg_video.bind(eos=_when_done)

```

The code below, however, does not. `_when_done()` is never called (which it should not be anyway, I think. It doesn't get called on the x64 ubuntu as well.), but the Video's `eos='loop'` seems to not do what it is supposed to. The video stops after exactly one play.

```python

bg_video = Video(
    source=value, state='play',
    allow_stretch=True, eos='loop'
)

def _when_done(*_):
    _bg_video.state = 'play'
_bg_video.bind(eos=_when_done)

```




Discussion:

Resolving patch:
diff --git a/kivy/core/video/__init__.py b/kivy/core/video/__init__.py
--- a/kivy/core/video/__init__.py
+++ b/kivy/core/video/__init__.py
@@ -37,7 +37,7 @@ class VideoBase(EventDispatcher):
             Action to take when EOS is hit. Can be one of 'pause', 'stop' or
             'loop'.
 
-            .. versionchanged:: unknown
+            .. versionchanged:: 1.4.0
                 added 'pause'
 
         `async`: bool, defaults to True
diff --git a/kivy/uix/video.py b/kivy/uix/video.py
--- a/kivy/uix/video.py
+++ b/kivy/uix/video.py
@@ -201,7 +201,6 @@ def on_state(self, instance, value):
             if self.eos:
                 self._video.stop()
                 self._video.position = 0.
-                self._video.eos = False
             self.eos = False
             self._video.play()
         elif value == 'pause':
@@ -209,7 +208,6 @@ def on_state(self, instance, value):
         else:
             self._video.stop()
             self._video.position = 0
-            self._video.eos = False
 
     def _on_video_frame(self, *largs):
         video = self._video


Test patch: