Skip to content

Latest commit

 

History

History
270 lines (170 loc) · 8.26 KB

audio-player.md

File metadata and controls

270 lines (170 loc) · 8.26 KB

audio_player

import "github.com/dueros/bot-sdk-go/bot/directive/audio_player"

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 (*PlayDirective) GetToken

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 (this *PlayDirective) SetProgressReportIntervalMs(intervalMs int) *PlayDirective

func (*PlayDirective) SetStreamFormat

func (this *PlayDirective) SetStreamFormat(format string) *PlayDirective

func (*PlayDirective) SetToken

func (this *PlayDirective) SetToken(token string) *PlayDirective

func (*PlayDirective) SetUrl

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 (*PlayerInfo) SetArt

func (this *PlayerInfo) SetArt(src string) *PlayerInfo

func (*PlayerInfo) SetLyric

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 (*PlayerInfo) SetTitle

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