This commit is contained in:
aynakeya
2024-04-10 00:42:33 -07:00
parent 8d73a3c284
commit f926f15606
145 changed files with 2852 additions and 4296 deletions

View File

@@ -1,54 +1,56 @@
package events
import (
"AynaLivePlayer/common/event"
"AynaLivePlayer/core/model"
)
//const (
// EventPlay event.EventId = "player.play"
// EventPlayed event.EventId = "player.played"
// EventPlaylistPreInsert event.EventId = "playlist.insert.pre"
// EventPlaylistInsert event.EventId = "playlist.insert.after"
// EventPlaylistUpdate event.EventId = "playlist.update"
// EventLyricUpdate event.EventId = "lyric.update"
// EventLyricReload event.EventId = "lyric.reload"
//)
const (
EventPlay event.EventId = "player.play"
EventPlayed event.EventId = "player.played"
EventPlaylistPreInsert event.EventId = "playlist.insert.pre"
EventPlaylistInsert event.EventId = "playlist.insert.after"
EventPlaylistUpdate event.EventId = "playlist.update"
EventLyricUpdate event.EventId = "lyric.update"
EventLyricReload event.EventId = "lyric.reload"
)
const ErrorUpdate = "update.error"
func EventPlayerPropertyUpdate(property model.PlayerProperty) event.EventId {
return event.EventId("player.property.update." + string(property))
type ErrorUpdateEvent struct {
Error error
}
type PlaylistInsertEvent struct {
Playlist *model.Playlist
Index int
Media *model.Media
}
type PlaylistUpdateEvent struct {
Playlist *model.Playlist // Playlist is a copy of the playlist
}
type PlayEvent struct {
Media *model.Media
}
type LyricUpdateEvent struct {
Lyrics *model.Lyric
Time float64
Lyric *model.LyricContext
}
type LyricReloadEvent struct {
Lyrics *model.Lyric
}
type PlayerPropertyUpdateEvent struct {
Property model.PlayerProperty
Value model.PlayerPropertyValue
}
type LiveRoomStatusUpdateEvent struct {
RoomTitle string
Status bool
}
//
//func EventPlayerPropertyUpdate(property model.PlayerProperty) event.EventId {
// return event.EventId("player.property.update." + string(property))
//}
//
//type PlaylistInsertEvent struct {
// Playlist *model.Playlist
// Index int
// Media *model.Media
//}
//
//type PlaylistUpdateEvent struct {
// Playlist *model.Playlist // Playlist is a copy of the playlist
//}
//
//type PlayEvent struct {
// Media *model.Media
//}
//
//type LyricUpdateEvent struct {
// Lyrics *model.Lyric
// Time float64
// Lyric *model.LyricContext
//}
//
//type LyricReloadEvent struct {
// Lyrics *model.Lyric
//}
//
//type PlayerPropertyUpdateEvent struct {
// Property model.PlayerProperty
// Value model.PlayerPropertyValue
//}
//
//type LiveRoomStatusUpdateEvent struct {
// RoomTitle string
// Status bool
//}