The introduction of the proprietary PhotoEditor SDK prevented this app from
being truly free and open source, and so F-Droid could no longer build the app.
By adding a licensing flavor dimension, we segregate the non-FOSS code to a
separate version, while providing a FOSS version without the editor.
To build the proprietary version, select one of the proprietary build variants
from Build Variants pane in Android Studio (on the left side of the window).
Fixes#1706.
It is never the case that `loopVideos == true` in the `videoCompleted` handler,
since enabling that preference sets `repeatMode`, which in turn prevents the
player from reaching `STATE_ENDED`. Thus, the branches are unreachable.
The previous loop method of seeking to the beginning at video completion ensured
that the seekbar and current time text were immediately reset. Using ExoPlayer's
own implementation of video looping means that `Player.STATE_ENDED` is no longer
reached, thus the UI no longer accurately tracks progress. Restore the old
behaviour by resetting the views on position discontinuity.
Now that videos are replacing the inefficient GIF format, gapless loops are
important. ExoPlayer's built-in mechanism prebuffers the video to enable this,
whereas the current implementation of seeking to the start presents a short but
noticeable delay between each loop.
Note that this change introduces an incompatibility with current behaviour: due
to google/ExoPlayer#6459, certain videos with broken audio tracks that played
fine before will no longer start. Disabling the audio track is a workaround to
re-enable looping playback, but ExoPlayer does not appear to expose a way to
check if the audio track is short enough to produce the bug.