community icon indicating copy to clipboard operation
community copied to clipboard

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

Open blurymind opened this issue 8 years ago • 4 comments

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?

blurymind avatar Mar 09 '18 15:03 blurymind

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

welcome[bot] avatar Mar 09 '18 15:03 welcome[bot]

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).

ghost avatar Mar 11 '18 11:03 ghost

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

blurymind avatar Mar 11 '18 12:03 blurymind

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

twoelz avatar Mar 24 '18 18:03 twoelz