Initial commit

This commit is contained in:
Aynakeya
2022-06-21 13:02:22 -07:00
commit 9f75839ebc
161 changed files with 18766 additions and 0 deletions

25
player/player_test.go Normal file
View File

@@ -0,0 +1,25 @@
package player
import (
"fmt"
"github.com/aynakeya/go-mpv"
"testing"
"time"
)
func TestPlayer(t *testing.T) {
player := NewPlayer()
player.Start()
defer player.Stop()
player.ObserveProperty("time-pos", func(property *mpv.EventProperty) {
fmt.Println(1, property.Data)
})
player.ObserveProperty("percent-pos", func(property *mpv.EventProperty) {
fmt.Println(2, property.Data)
})
player.Play(&Media{
Url: "https://ia600809.us.archive.org/19/items/VillagePeopleYMCAOFFICIALMusicVideo1978/Village%20People%20-%20YMCA%20OFFICIAL%20Music%20Video%201978.mp4",
})
time.Sleep(time.Second * 15)
}