Kivy: video.position = value doesnt work (kivy.uix.video) and seek works only with percentage, not actual position

Created on 9 Mar 2018  路  4Comments  路  Source: kivy/kivy

Versions

  • Python: 3
  • OS: windows 10
  • Kivy: latest
  • Kivy installation method: pip

    Description

Trying to set the video widget's streaming position value does not actually set the video stream's position.
I can get position, but cannot set position

The only way to set the video to a position from within the python file is via the seek() method of the widget. However seek only takes 0-1 % value. In my use case I need to set precise position in a value that is compatible with duration.

How do we do that?

A workaround that comes to mind is converting the position value (which I can get) to a percentage value of duration - but thats kind of hacky, isn't it?

All 4 comments

馃憢 Thanks for opening your first issue here! Be sure to follow the issue template!

A workaround that comes to mind is converting the position value [...]

I don't have any better suggestions, if you want it to work with current releases this is probably what it boils down to... Looking at kivy/core/video/__init__.py seems a bit weird to me, setting the position property actually calls seek with the value, source link. That doesn't seem right, position is in seconds, seek wants a percentage (at least according to its signature).

@bionoid you are right. We should have another function to seek in seconds when position is set

I agree with this proposed change, allowing setting position makes more sense.

Was this page helpful?
0 / 5 - 0 ratings