rtc

package
v1.0.106 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegion          = "cn-north-1"
	ServiceVersion20201201 = "2020-12-01"
	ServiceVersion20220601 = "2022-06-01"
	ServiceName            = "rtc"
	ServiceHost            = "rtc.volcengineapi.com"

	// action name
	ActionStartRecord      = "StartRecord"
	ActionGetRecordTask    = "GetRecordTask"
	ActionStartWebRecord   = "StartWebRecord"
	ActionStopWebRecord    = "StopWebRecord"
	ActionGetWebRecordTask = "GetWebRecordTask"
	ActionGetWebRecordList = "GetWebRecordList"
)

Variables

View Source
var (
	ServiceInfo = &base.ServiceInfo{
		Timeout: 5 * time.Second,
		Host:    ServiceHost,
		Header: http.Header{
			"Accept": []string{"application/json"},
		},
	}

	DefaultApiInfoList = map[string]*base.ApiInfo{
		ActionStartRecord: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionStartRecord},
				"Version": []string{ServiceVersion20220601},
			},
		},
		ActionGetRecordTask: {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionGetRecordTask},
				"Version": []string{ServiceVersion20220601},
			},
		},
		ActionStartWebRecord: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionStartWebRecord},
				"Version": []string{ServiceVersion20201201},
			},
		},
		ActionStopWebRecord: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionStopWebRecord},
				"Version": []string{ServiceVersion20201201},
			},
		},
		ActionGetWebRecordTask: {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionGetWebRecordTask},
				"Version": []string{ServiceVersion20201201},
			},
		},
		ActionGetWebRecordList: {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionGetWebRecordList},
				"Version": []string{ServiceVersion20201201},
			},
		},
	}
)

Functions

This section is empty.

Types

type CommonResponse

type CommonResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           json.RawMessage `json:"Result,omitempty"`
}

CommonResponse ... need to decode result by type

type CustomConfig

type CustomConfig struct {
	Vendor    uint32 `json:"Vendor"`
	Region    string `json:"Region"`
	Bucket    string `json:"Bucket"`
	AccessKey string `json:"AccessKey"`
	SecretKey string `json:"SecretKey"`
}

type Encode

type Encode struct {
	VideoWidth   uint32 `json:"VideoWidth"`
	VideoHeight  uint32 `json:"VideoHeight"`
	VideoFps     uint32 `json:"VideoFps"`
	VideoBitrate uint32 `json:"VideoBitrate"`
}

type File

type File struct {
	Index     int
	Bucket    string
	ObjectKey string
}

type FileFormatConfig

type FileFormatConfig struct {
	FileFormat []string
}

type GetRecordTaskResponse

type GetRecordTaskResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *GetRecordTaskResult `json:"Result,omitempty"`
}

GetRecordTaskResponse ...

func GetRecordTask

func GetRecordTask(r *RTC, query url.Values) (*GetRecordTaskResponse, int, error)

GET method GetRecordTask ...

type GetRecordTaskResult

type GetRecordTaskResult struct {
	RecordTask RecordTask `json:"RecordTask"`
}

type GetWebRecordListResponse

type GetWebRecordListResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *GetWebRecordListResult `json:"Result,omitempty"`
}

func GetWebRecordList

func GetWebRecordList(r *RTC, query url.Values) (*GetWebRecordListResponse, int, error)

type GetWebRecordListResult

type GetWebRecordListResult struct {
	Message       string        `json:"Message"`
	WebRecordList WebRecordList `json:"WebRecordList"`
}

type GetWebRecordTaskResponse

type GetWebRecordTaskResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *GetWebRecordTaskResult `json:"Result,omitempty"`
}

func GetWebRecordTask

func GetWebRecordTask(r *RTC, query url.Values) (*GetWebRecordTaskResponse, int, error)

type GetWebRecordTaskResult

type GetWebRecordTaskResult struct {
	Message   string        `json:"Message"`
	EventData TaskEventData `json:"EventData"`
}

type RTC

type RTC struct {
	Client *base.Client
}

RTC ... use base client

func NewInstance

func NewInstance() *RTC

NewInstance ...

type RecordFile

type RecordFile struct {
	Vid         string   `json:"Vid"`
	ObjectKey   string   `json:"ObjectKey"`
	Duration    uint64   `json:"Duration"`
	Size        uint64   `json:"Size"`
	StartTime   uint64   `json:"StartTime"`
	StreamList  []Stream `json:"StreamList"`
	VideoCodec  string   `json:"VideoCodec"`
	AudioCodec  string   `json:"AudioCodec"`
	VideoWidth  int      `json:"VideoWidth"`
	VideoHeight int      `json:"VideoHeight"`
}

type RecordTask

type RecordTask struct {
	StartTime      uint64       `json:"StartTime"`
	EndTime        uint64       `json:"EndTime"`
	Status         uint64       `json:"Status"`
	StopReason     string       `json:"StopReason"`
	RecordFileList []RecordFile `json:"RecordFileList"`
}

type StartRecordRequest

type StartRecordRequest struct {
	AppId            string            `json:"AppId"`
	BusinessId       string            `json:"BusinessId"`
	RoomId           string            `json:"RoomId"`
	TaskId           string            `json:"TaskId"`
	RecordMode       uint32            `json:"RecordMode"`
	Encode           *Encode           `json:"Encode,omitempty"`
	FileFormatConfig *FileFormatConfig `json:"FileFormatConfig,omitempty"`
	StorageConfig    StorageConfig     `json:"StorageConfig"`
}

StartRecordRequest ...

type StartRecordResponse

type StartRecordResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           string `json:"Result,omitempty"`
}

StartRecordResponse ...

func StartRecord

func StartRecord(r *RTC, req *StartRecordRequest) (*StartRecordResponse, int, error)

POST method StartRecord ...

type StartWebRecordRequest

type StartWebRecordRequest struct {
	AppId           string
	TaskId          string
	InputURL        string
	MaxRecordSecond int
	JsCommand       []string
	Bucket          string
	VideoSpace      string
	VideoInfo       WebVideoInfo
	PageInfo        WebPageInfo
	Duration        int
}

type StartWebRecordResponse

type StartWebRecordResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *StartWebRecordResult `json:"Result,omitempty"`
}

func StartWebRecord

func StartWebRecord(r *RTC, req *StartWebRecordRequest) (*StartWebRecordResponse, int, error)

type StartWebRecordResult

type StartWebRecordResult struct {
	Message string `json:"Message"`
}

type StopWebRecordRequest

type StopWebRecordRequest struct {
	AppId  string
	TaskId string
}

type StopWebRecordResponse

type StopWebRecordResponse struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *StopWebRecordResult `json:"Result,omitempty"`
}

func StopWebRecord

func StopWebRecord(r *RTC, req *StopWebRecordRequest) (*StopWebRecordResponse, int, error)

type StopWebRecordResult

type StopWebRecordResult struct {
	Message string `json:"Message"`
}

type StorageConfig

type StorageConfig struct {
	Type         uint32        `json:"Type"`
	TosConfig    *TosConfig    `json:"TosConfig,omitempty"`
	CustomConfig *CustomConfig `json:"CustomConfig,omitempty"`
}

type Stream

type Stream struct {
	Index      uint32 `json:"Index"`
	StreamType uint32 `json:"StreamType"`
	UserId     string `json:"UserId"`
}

type TaskEventData

type TaskEventData struct {
	TaskId     string `json:"TaskId"`
	Status     int    `json:"Status"`
	CreateTime int    `json:"CreateTime"`
	FinishTime int    `json:"FinishTime"`
	Vid        string `json:"Vid"`
	FinalFile  File   `json:"FinalFile"`
	Files      []File `json:"Files"`
}

type Tasks

type Tasks struct {
	TaskId          string `json:"TaskId"`
	CreateTime      int    `json:"CreateTime"`
	FinishTime      int    `json:"FinishTime"`
	Status          int    `json:"Status"`
	InputURL        string `json:"InputURL"`
	VideoSpace      string `json:"VideoSpace"`
	Vid             string `json:"Vid"`
	MaxRecordSecond int    `json:"MaxRecordSecond"`
	Duration        int    `json:"Duration"`
	Bucket          string `json:"Bucket"`
	ObjectKey       string `json:"ObjectKey"`
}

type TosConfig

type TosConfig struct {
	AccountId string `json:"AccountId"`
	Region    uint32 `json:"Region"`
	Bucket    string `json:"Bucket"`
}

type WebPageInfo

type WebPageInfo struct {
	PageWidth  int
	PageHeight int
}

type WebRecordList

type WebRecordList struct {
	AppId      string  `json:"AppId"`
	Tasks      []Tasks `json:"Tasks"`
	PageNumber int     `json:"PageNumber"`
	PageSize   int     `json:"PageSize"`
	TotalCount int     `json:"TotalCount"`
}

type WebVideoInfo

type WebVideoInfo struct {
	ResolutionWidth  int
	ResolutionHeight int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL