diff --git a/cmd/mpv.go b/cmd/mpv.go index fd4b0b3..21a19a3 100644 --- a/cmd/mpv.go +++ b/cmd/mpv.go @@ -130,8 +130,11 @@ func (mpv *MPVPLayer) finishedVideo() (bool, error) { mpv.isPlaying = false if len(mpv.entries) == 1 { - if err := mpv.play(mpv.entries[0].Link); err != nil { - return false, err + if videoPercentageWatched(mpv.VideoPosition(), mpv.VideoDuration()) > 90 { + if err := mpv.play(mpv.entries[0].Link); err != nil { + return false, err + } + } } @@ -209,6 +212,7 @@ func (mpv *MPVPLayer) ensurePlayer() error { mpv.Unlock() } } else if event.ID == 3 { + // TODO: this might not fire once the media ends if event.Data != nil { if event.Data.(bool) == true { mpv.Lock()