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

36
player/media.go Normal file
View File

@@ -0,0 +1,36 @@
package player
import "AynaLivePlayer/liveclient"
type Media struct {
Title string
Artist string
Cover string
Album string
Lyric string
Url string
Header map[string]string
User interface{}
Meta interface{}
}
func (m *Media) ToUser() *User {
if u, ok := m.User.(*User); ok {
return u
}
return &User{Name: m.DanmuUser().Username}
}
func (m *Media) SystemUser() *User {
if u, ok := m.User.(*User); ok {
return u
}
return nil
}
func (m *Media) DanmuUser() *liveclient.DanmuUser {
if u, ok := m.User.(*liveclient.DanmuUser); ok {
return u
}
return nil
}