rtc

package
v1.0.36 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegion          = base.RegionApSingapore
	ServiceVersion20201201 = "2020-12-01"
	ServiceVersion20220601 = "2022-06-01"
	ServiceName            = "rtc"
	//Please replace it with the address in the official website document
	ServiceHost = "open.byteplusapi.com"

	// action name
	ActionStartRecord   = "StartRecord"
	ActionGetRecordTask = "GetRecordTask"
)

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},
			},
		},
	}
)

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    uint32 `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 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 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 StorageConfig

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

type Stream

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

type VodConfig

type VodConfig struct {
	AccountId string `json:"AccountId"`
	Region    uint32 `json:"Region"`
	Space     string `json:"Space"`
}

Jump to

Keyboard shortcuts

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