rui_orig/audioPlayer.go

32 lines
695 B
Go
Raw Permalink Normal View History

2021-09-07 17:36:50 +03:00
package rui
// AudioPlayer is a type of a [View] which can play audio files
2021-09-07 17:36:50 +03:00
type AudioPlayer interface {
MediaPlayer
}
type audioPlayerData struct {
mediaPlayerData
}
// NewAudioPlayer create new MediaPlayer object and return it
2021-11-04 21:21:42 +03:00
func NewAudioPlayer(session Session, params Params) AudioPlayer {
2021-09-07 17:36:50 +03:00
view := new(audioPlayerData)
view.init(session)
2021-09-07 17:36:50 +03:00
setInitParams(view, params)
return view
}
func newAudioPlayer(session Session) View {
2024-11-13 12:56:39 +03:00
return new(audioPlayerData) // NewAudioPlayer(session, nil)
2021-09-07 17:36:50 +03:00
}
func (player *audioPlayerData) init(session Session) {
player.mediaPlayerData.init(session)
2021-09-07 17:36:50 +03:00
player.tag = "AudioPlayer"
}
func (player *audioPlayerData) htmlTag() string {
return "audio"
}