mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-19 00:13:30 +08:00
Initial commit
This commit is contained in:
25
player/player_test.go
Normal file
25
player/player_test.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user