Wunderfitz / harbour-fernschreiber

Fernschreiber is a Telegram client for Sailfish OS
GNU General Public License v3.0
42 stars 33 forks source link

messageAnimation loop #360

Open jgibbon opened 3 years ago

jgibbon commented 3 years ago

Even though it'll not be perfect due to the qt limitations (manual loop handling; visible breaks before restarting), sub-one-second animations are barely visible without looping.

jgibbon commented 3 years ago

See https://github.com/Wunderfitz/harbour-fernschreiber/blob/fba20712b23cc288722196a71d68cc09d95512d3/qml/components/inlineQueryResults/InlineQueryResultAnimation.qml#L261 for example implementation.

fridlmue commented 3 years ago

Probably it is possible to stack two times the same Animation and start and stop them and hide and show alternating. Will be difficult from the timing-side, but could be possible.

monich commented 3 years ago

There's bug in a Sailfish OS specific gstreamer plugin which causes video playback to stop a few hundred milliseconds too early, which is especially noticeable on short (e.g. 1 sec) videos/animations. Looping won't look perfect. I actually prototyped it at some point, didn't like the result and decided not to submit the patch.

This recent change in droidmedia should improve the simulation. But it's not part of any public release yet.

jgibbon commented 3 years ago

The droidmedia change mentioned above landed in SFOS 4.0, but "built-in" loops (MediaPlayer) still have a considerable pauses (VideoOutput gets transparent for a while) before restarting videos from the beginning. A possible Workaround may be to just seek(0) when onStopped is emitted (since we just pause otherwise instead of stopping). I haven't tried that, yet.