import "github.com/dueros/bot-sdk-go/bot/directive/audio_player"
- Constants
- type PlayDirective
- func NewPlayDirective(url string) *PlayDirective
- func (this *PlayDirective) GetToken(token string) string
- func (this *PlayDirective) SetBehavior(behavior string) *PlayDirective
- func (this *PlayDirective) SetOffsetInMilliseconds(milliseconds int) *PlayDirective
- func (this *PlayDirective) SetPlayerInfo(playerInfo *PlayerInfo) *PlayDirective
- func (this *PlayDirective) SetProgressReportIntervalMs(intervalMs int) *PlayDirective
- func (this *PlayDirective) SetStreamFormat(format string) *PlayDirective
- func (this *PlayDirective) SetToken(token string) *PlayDirective
- func (this *PlayDirective) SetUrl(url string) *PlayDirective
- type PlayerInfo
- func NewPlayerInfo() *PlayerInfo
- func (this *PlayerInfo) SetArt(src string) *PlayerInfo
- func (this *PlayerInfo) SetLyric(url string) *PlayerInfo
- func (this *PlayerInfo) SetMediaLengthInMs(length uint64) *PlayerInfo
- func (this *PlayerInfo) SetProviderLogo(logo string) *PlayerInfo
- func (this *PlayerInfo) SetProviderName(name string) *PlayerInfo
- func (this *PlayerInfo) SetTitle(title string) *PlayerInfo
- func (this *PlayerInfo) SetTitleSubtext1(text string) *PlayerInfo
- func (this *PlayerInfo) SetTitleSubtext2(text string) *PlayerInfo
- type StopDirective
const.go play.go player_info.go stop.go
const (
REPLACE_ALL = "REPLACE_ALL"
REPLACE_ENQUEUED = "REPLACE_ENQUEUED"
ENQUEUE = "ENQUEUE"
AUDIO_MP3 = "AUDIO_MP3"
AUDIO_M3U8 = "AUDIO_M3U8"
AUDIO_M4A = "AUDIO_M4A"
AUDIO_TYPE_MUSIC = "MUSIC"
LYRIC_FORMAT_LRC = "LRC"
)
type PlayDirective struct {
directive.BaseDirective
PlayBehavior string `json:"playBehavior"`
AudioItem struct {
Stream struct {
Url string `json:"url"`
StreamFormat string `json:"streamFormat"`
OffsetInMilliseconds int `json:"offsetInMilliSeconds"`
Token string `json:"token"`
ProgressReportIntervalMs int `json:"progressReportIntervalMs,omitempty"`
} `json:"stream"`
PlayerInfo *PlayerInfo `json:"playerInfo,omitempty"`
} `json:"audioItem"`
}
func NewPlayDirective(url string) *PlayDirective
func (this *PlayDirective) GetToken(token string) string
func (*PlayDirective) SetBehavior
func (this *PlayDirective) SetBehavior(behavior string) *PlayDirective
func (*PlayDirective) SetOffsetInMilliseconds
func (this *PlayDirective) SetOffsetInMilliseconds(milliseconds int) *PlayDirective
func (*PlayDirective) SetPlayerInfo
func (this *PlayDirective) SetPlayerInfo(playerInfo *PlayerInfo) *PlayDirective
func (*PlayDirective) SetProgressReportIntervalMs
func (this *PlayDirective) SetProgressReportIntervalMs(intervalMs int) *PlayDirective
func (*PlayDirective) SetStreamFormat
func (this *PlayDirective) SetStreamFormat(format string) *PlayDirective
func (this *PlayDirective) SetToken(token string) *PlayDirective
func (this *PlayDirective) SetUrl(url string) *PlayDirective
type PlayerInfo struct {
Content struct {
AudioItemType string `json:"audioItemType"`
Title string `json:"title"`
TitleSubtext1 string `json:"titleSubtext1"`
TitleSubtext2 string `json:"titleSubtext2"`
Lyric struct {
Url string `json:"url"`
Format string `json:"format"`
} `json:"lyric"`
MediaLengthInMilliseconds uint64 `json:"mediaLengthInMilliseconds,omitempty"`
Art struct {
Src string `json:"src"`
} `json:"art"`
Provider struct {
Name string `json:"name"`
Logo struct {
Src string `json:"src"`
} `json:"logo"`
} `json:"provider"`
} `json:"content"`
}
func NewPlayerInfo() *PlayerInfo
func (this *PlayerInfo) SetArt(src string) *PlayerInfo
func (this *PlayerInfo) SetLyric(url string) *PlayerInfo
func (*PlayerInfo) SetMediaLengthInMs
func (this *PlayerInfo) SetMediaLengthInMs(length uint64) *PlayerInfo
func (*PlayerInfo) SetProviderLogo
func (this *PlayerInfo) SetProviderLogo(logo string) *PlayerInfo
func (*PlayerInfo) SetProviderName
func (this *PlayerInfo) SetProviderName(name string) *PlayerInfo
func (this *PlayerInfo) SetTitle(title string) *PlayerInfo
func (*PlayerInfo) SetTitleSubtext1
func (this *PlayerInfo) SetTitleSubtext1(text string) *PlayerInfo
func (*PlayerInfo) SetTitleSubtext2
func (this *PlayerInfo) SetTitleSubtext2(text string) *PlayerInfo
type StopDirective struct {
directive.BaseDirective
}
func NewStopDirective() *StopDirective
Generated by godoc2md