update shit
This commit is contained in:
parent
dae22a9716
commit
2e3e74e128
1 changed files with 6 additions and 2 deletions
|
@ -130,9 +130,12 @@ func (mpv *MPVPLayer) finishedVideo() (bool, error) {
|
||||||
mpv.isPlaying = false
|
mpv.isPlaying = false
|
||||||
|
|
||||||
if len(mpv.entries) == 1 {
|
if len(mpv.entries) == 1 {
|
||||||
|
if videoPercentageWatched(mpv.VideoPosition(), mpv.VideoDuration()) > 90 {
|
||||||
if err := mpv.play(mpv.entries[0].Link); err != nil {
|
if err := mpv.play(mpv.entries[0].Link); err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, nil
|
return false, nil
|
||||||
|
@ -209,6 +212,7 @@ func (mpv *MPVPLayer) ensurePlayer() error {
|
||||||
mpv.Unlock()
|
mpv.Unlock()
|
||||||
}
|
}
|
||||||
} else if event.ID == 3 {
|
} else if event.ID == 3 {
|
||||||
|
// TODO: this might not fire once the media ends
|
||||||
if event.Data != nil {
|
if event.Data != nil {
|
||||||
if event.Data.(bool) == true {
|
if event.Data.(bool) == true {
|
||||||
mpv.Lock()
|
mpv.Lock()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue