rui_orig/audioPlayer.go

37 lines
784 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
view.tag = "AudioPlayer"
setInitParams(view, params)
return view
}
func newAudioPlayer(session Session) View {
return NewAudioPlayer(session, nil)
}
func (player *audioPlayerData) init(session Session) {
player.mediaPlayerData.init(session)
2021-09-07 17:36:50 +03:00
player.tag = "AudioPlayer"
}
2022-05-22 12:54:02 +03:00
func (player *audioPlayerData) String() string {
return getViewString(player, nil)
2022-05-22 12:54:02 +03:00
}
2021-09-07 17:36:50 +03:00
func (player *audioPlayerData) htmlTag() string {
return "audio"
}