mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-13 13:38:16 +08:00
rewrite
This commit is contained in:
@@ -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
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user