Documentation
¶
Index ¶
- Constants
- type Acquire
- type AcquireClientRequest
- type AcquireReqBody
- type AcquireResp
- type AcquireSuccessResp
- type BackgroundConfig
- type ErrResponse
- type ExtensionParams
- type ExtensionService
- type ExtensionServiceConfig
- type LayoutConfig
- type Outputs
- type Query
- type QueryIndividualRecordingServerResponse
- type QueryIndividualVideoScreenshotServerResponse
- type QueryMixRecordingHLSAndMP4ServerResponse
- type QueryMixRecordingHLSServerResponse
- type QueryResp
- type QueryRespServerResponseMode
- type QueryRtmpPublishServerResponse
- type QuerySuccessResp
- func (q *QuerySuccessResp) GetIndividualRecordingServerResponse() *QueryIndividualRecordingServerResponse
- func (q *QuerySuccessResp) GetIndividualVideoScreenshotServerResponse() *QueryIndividualVideoScreenshotServerResponse
- func (q *QuerySuccessResp) GetMixRecordingHLSAndMP4ServerResponse() *QueryMixRecordingHLSAndMP4ServerResponse
- func (q *QuerySuccessResp) GetMixRecordingHLSServerResponse() *QueryMixRecordingHLSServerResponse
- func (q *QuerySuccessResp) GetRtmpPublishServiceServerResponse() *QueryRtmpPublishServerResponse
- func (q *QuerySuccessResp) GetServerResponseMode() QueryRespServerResponseMode
- func (q *QuerySuccessResp) GetWebRecording2CDNServerResponse() *QueryWebRecordingServerResponse
- type QueryWebRecordingServerResponse
- type RecordingConfig
- type RecordingFileConfig
- type Response
- type RtmpPublishServiceParam
- type ServiceParamInterface
- type SnapshotConfig
- type Start
- type StartClientRequest
- type StartReqBody
- type StartResp
- type StartSuccessResp
- type Stop
- type StopClientRequest
- type StopReqBody
- type StopResp
- type StopRespServerResponseMode
- type StopSuccessResp
- type StorageConfig
- type TranscodingConfig
- type Update
- type UpdateAudioUIDList
- type UpdateClientRequest
- type UpdateLayout
- type UpdateLayoutClientRequest
- type UpdateLayoutConfig
- type UpdateLayoutReqBody
- type UpdateLayoutResp
- type UpdateLayoutSuccessResp
- type UpdateOutput
- type UpdateReqBody
- type UpdateResp
- type UpdateRtmpPublishConfig
- type UpdateStreamSubscribe
- type UpdateSuccessResp
- type UpdateVideoUIDList
- type UpdateWebRecordingConfig
- type WebRecordingServiceParam
Constants ¶
const ( IndividualMode = "individual" MixMode = "mix" WebMode = "web" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acquire ¶
type Acquire struct {
// contains filtered or unexported fields
}
func NewAcquire ¶
func (*Acquire) Do ¶
func (a *Acquire) Do(ctx context.Context, payload *AcquireReqBody) (*AcquireResp, error)
type AcquireClientRequest ¶
type AcquireClientRequest struct {
Scene int `json:"scene"`
StartParameter *StartClientRequest `json:"startParameter,omitempty"`
ResourceExpiredHour int `json:"resourceExpiredHour,omitempty"`
ExcludeResourceIds []string `json:"excludeResourceIds,omitempty"`
RegionAffinity int `json:"regionAffinity,omitempty"`
}
type AcquireReqBody ¶
type AcquireReqBody struct {
Cname string `json:"cname"`
Uid string `json:"uid"`
ClientRequest *AcquireClientRequest `json:"clientRequest"`
}
type AcquireResp ¶
type AcquireResp struct {
// Response returned by the cloud recording API, see Response for details
Response
// Successful response, see AcquireSuccessResp for details
SuccessRes AcquireSuccessResp
}
@brief AcquireResp returned by the various of cloud recording scenarios Acquire API.
@since v0.8.0
type AcquireSuccessResp ¶
type AcquireSuccessResp struct {
// Unique identifier of the resource
ResourceId string `json:"resourceId"`
}
@brief Successful response returned by the various of cloud recording scenarios Acquire API.
@since v0.8.0
type BackgroundConfig ¶
type BackgroundConfig struct {
// The string content is the UID.(Required)
UID string `json:"uid"`
// The URL of the user's background image.(Required)
//
// After setting the background image, if the user stops sending the video stream for more than 3.5 seconds,
// the screen will switch to the background image.
// URL supports the HTTP and HTTPS protocols, and the image formats supported are JPG and BMP.
// The image size must not exceed 6 MB.
// The settings will only take effect after the recording service successfully downloads the image;
// if the download fails, the settings will not take effect.
// Different field settings may overlap each other.
ImageURL string `json:"image_url"`
// The display mode of users' video windows.(Optional)
//
// The value can be set to:
//
// - 0: cropped mode.(Default)
// Prioritize to ensure the screen is filled.
// The video window size is proportionally scaled until it fills the screen.
// If the video's length and width differ from the video window,
// the video stream will be cropped from its edges to fit the window, under the aspect ratio set for the video window.
// - 1: Fit mode.
// Prioritize to ensure that all video content is displayed.
// The video size is scaled proportionally until one side of the video window is aligned with the screen border.
RenderMode int `json:"render_mode"`
}
@brief Configurations of user's background image.
@since v0.8.0
type ErrResponse ¶
type ErrResponse struct {
// Error code
ErrorCode int `json:"code"`
// Reason for the error
Reason string `json:"reason"`
}
@brief Error response returned by the cloud recording API.
@since v0.8.0
type ExtensionParams ¶
type ExtensionParams struct {
// The encryption mode.(Required)
//
// This field is only applicable to Amazon S3,
// and the value can be set to:
//
// - "kms": KMS encryption.
// - "aes256": AES256 encryption.
SSE string `json:"sse"`
// Tag content.(Required)
//
// After setting this field, the third-party cloud storage service
// will tag the uploaded recording files according to the content of this tag.
// This field is only applicable to Alibaba Cloud and Amazon S3.
// For other third-party cloud storage services, this field is not required.
Tag string `json:"tag"`
// Domain name of self-built cloud storage.(Optional)
//
// This field is required when vendor is set to 11.
Endpoint string `json:"endpoint,omitempty"`
}
@brief Third-party cloud storage services will encrypt and tag the uploaded recording files according to this field.
@since v0.8.0
type ExtensionService ¶
type ExtensionService struct {
// Name of the extended service.(Required)
//
// The service name can be set to:
//
// - "web_recorder_service": Represents the extended service is web page recording.
// - "rtmp_publish_service": Represents the extended service is to push web page recording to the CDN.
ServiceName string `json:"serviceName"`
// Error handling strategy within the extension service.(Optional)
//
// The error handling strategy can be set to:
//
// - "error_abort": the default and only value during web page recording.
// Stop other extension services when the current extension service encounters an error.
// - "error_ignore": The only default value when you push the web page recording to the CDN.
// Other extension services are not affected when the current extension service encounters an error.
ErrorHandlePolicy string `json:"errorHandlePolicy"`
// Specific configurations for extension services.(Required)
//
// - "WebRecordingServiceParam" for web page recording. See WebRecordingServiceParam for details.
// - "RtmpPublishServiceParam" for pushing web page recording to the CDN. See RtmpPublishServiceParam for details.
ServiceParam ServiceParamInterface `json:"serviceParam"`
}
@brief Configuration for extended services.
@since v0.8.0
type ExtensionServiceConfig ¶
type ExtensionServiceConfig struct {
// Error handling policy.(Optional)
//
// You can only set it to the default value, "error_abort",
// which means that once an error occurs to an extension service,
// all other non-extension services, such as stream subscription, also stop.
ErrorHandlePolicy string `json:"errorHandlePolicy,omitempty"`
// Extended services.(Required)
ExtensionServices []ExtensionService `json:"extensionServices"`
}
@brief Configurations for extended services.
@since v0.8.0
type LayoutConfig ¶
type LayoutConfig struct {
// The content of the string is the UID of the user to be displayed in the area, 32-bit unsigned integer.
UID string `json:"uid"`
// The relative value of the horizontal coordinate of the upper-left corner of the screen,
// accurate to six decimal places.
//
// Layout from left to right, with 0.0 at the far left and 1.0 at the far right.
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
XAxis float32 `json:"x_axis"`
// The relative value of the vertical coordinate of the upper-left corner of this screen in the screen,
// accurate to six decimal places.
//
// Layout from top to bottom, with 0.0 at the top and 1.0 at the bottom.
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
YAxis float32 `json:"y_axis"`
// The relative value of the width of this screen, accurate to six decimal places.
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
Width float32 `json:"width"`
// The relative value of the height of this screen, accurate to six decimal places.
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
Height float32 `json:"height"`
// The transparency of the user's video window. Accurate to six decimal places.
//
// 0.0 means the user's video window is transparent, and 1.0 indicates that it is completely opaque.
//
// The value range is [0,1].
//
// The default value is 1.
Alpha float32 `json:"alpha,omitempty"`
// The display mode of users' video windows.
//
// The rendering mode can be set to:
//
// - 0: Cropped mode.(Default)
// Prioritize to ensure the screen is filled.
// The video window size is proportionally scaled until it fills the screen.
// If the video's length and width differ from the video window,
// the video stream will be cropped from its edges to fit the window,
// under the aspect ratio set for the video window.
// - 1: Fit mode.
// Prioritize to ensure that all video content is displayed.
// The video size is scaled proportionally until one side of the video window is aligned with the screen border.
// If the video scale does not comply with the window size,
// the video will be scaled to fill the screen while maintaining its aspect ratio.
// This scaling may result in a black border around the edges of the video.
RenderMode int `json:"render_mode"`
}
@brief Configurations of user's layout.
@since v0.8.0
type Outputs ¶
type Outputs struct {
// The CDN address to which you push the stream.(Required)
RtmpURL string `json:"rtmpUrl"`
}
@brief The CDN address to which you push the stream.
@since v0.8.0
type QueryIndividualRecordingServerResponse ¶
type QueryIndividualRecordingServerResponse struct {
// Current status of the cloud service:
//
// - 0: Cloud service has not started.
//
// - 1: The cloud service initialization is complete.
//
// - 2: The cloud service components are starting.
//
// - 3: Some cloud service components are ready.
//
// - 4: All cloud service components are ready.
//
// - 5: The cloud service is in progress.
//
// - 6: The cloud service receives the request to stop.
//
// - 7: All components of the cloud service stop.
//
// - 8: The cloud service exits.
//
// - 20: The cloud service exits abnormally.
Status int `json:"status"`
// The data format of the fileList field:
//
// - "string": fileList is of String type. In composite recording mode,
// if avFileType is set to ["hls"], fileListMode is "string".
//
// - "json": fileList is a JSON Array. When avFileType is set to ["hls","mp4"]
// in the individual or composite recording mode, fileListMode is set to "json".
FileListMode string `json:"fileListMode"`
// The file list.
FileList []struct {
// The file names of the M3U8 and MP4 files generated during recording.
FileName string `json:"fileName"`
// The recording file type.
//
// - "audio": Audio-only files.
//
// - "video": Video-only files.
//
// - "audio_and_video": audio and video files
TrackType string `json:"trackType"`
// User UID, indicating which user's audio or video stream is being recorded.
//
// In composite recording mode, the uid is "0".
Uid string `json:"uid"`
// Whether the users were recorded separately.
//
// - true: All users are recorded in a single file.
//
// - false: Each user is recorded separately.
MixedAllUser bool `json:"mixedAllUser"`
// Whether or not can be played online.
//
// - true: The file can be played online.
//
// - false: The file cannot be played online.
IsPlayable bool `json:"isPlayable"`
// The recording start time of the file, the Unix timestamp, in seconds.
SliceStartTime int64 `json:"sliceStartTime"`
} `json:"fileList"`
// The recording start time of the file, the Unix timestamp, in seconds.
SliceStartTime int64 `json:"sliceStartTime"`
}
@brief Server response returned by the individual recording Query API.
@since v0.8.0
type QueryIndividualVideoScreenshotServerResponse ¶
type QueryIndividualVideoScreenshotServerResponse struct {
// Current status of the cloud service:
//
// - 0: Cloud service has not started.
//
// - 1: The cloud service initialization is complete.
//
// - 2: The cloud service components are starting.
//
// - 3: Some cloud service components are ready.
//
// - 4: All cloud service components are ready.
//
// - 5: The cloud service is in progress.
//
// - 6: The cloud service receives the request to stop.
//
// - 7: All components of the cloud service stop.
//
// - 8: The cloud service exits.
//
// - 20: The cloud service exits abnormally.
Status int `json:"status"`
// The recording start time of the file, the Unix timestamp, in seconds.
SliceStartTime int64 `json:"sliceStartTime"`
}
@brief Server response returned by the individual recording QueryVideoScreenshot API.
@since v0.8.0
type QueryMixRecordingHLSAndMP4ServerResponse ¶
type QueryMixRecordingHLSAndMP4ServerResponse struct {
// Current status of the cloud service:
//
// - 0: Cloud service has not started.
//
// - 1: The cloud service initialization is complete.
//
// - 2: The cloud service components are starting.
//
// - 3: Some cloud service components are ready.
//
// - 4: All cloud service components are ready.
//
// - 5: The cloud service is in progress.
//
// - 6: The cloud service receives the request to stop.
//
// - 7: All components of the cloud service stop.
//
// - 8: The cloud service exits.
//
// - 20: The cloud service exits abnormally.
Status int `json:"status"`
// The data format of the fileList field:
//
// - "string": fileList is of String type. In composite recording mode,
// if avFileType is set to ["hls"], fileListMode is "string".
//
// - "json": fileList is a JSON Array. When avFileType is set to ["hls","mp4"]
// in the individual or composite recording mode, fileListMode is set to "json".
FileListMode string `json:"fileListMode"`
// The file list.
FileList []struct {
// The file names of the M3U8 and MP4 files generated during recording.
FileName string `json:"fileName"`
// The recording file type.
//
// - "audio": Audio-only files.
//
// - "video": Video-only files.
//
// - "audio_and_video": audio and video files
TrackType string `json:"trackType"`
// User UID, indicating which user's audio or video stream is being recorded.
//
// In composite recording mode, the uid is "0".
Uid string `json:"uid"`
// Whether the users were recorded separately.
//
// - true: All users are recorded in a single file.
//
// - false: Each user is recorded separately.
MixedAllUser bool `json:"mixedAllUser"`
// Whether or not can be played online.
//
// - true: The file can be played online.
//
// - false: The file cannot be played online.
IsPlayable bool `json:"isPlayable"`
// The recording start time of the file, the Unix timestamp, in seconds.
SliceStartTime int64 `json:"sliceStartTime"`
} `json:"fileList"`
// The recording start time of the file, the Unix timestamp, in seconds.
SliceStartTime int64 `json:"sliceStartTime"`
}
@brief Server response returned by the mix recording QueryHLSAndMP4 API.
@since v0.8.0
type QueryMixRecordingHLSServerResponse ¶
type QueryMixRecordingHLSServerResponse struct {
// Current status of the cloud service:
//
// - 0: Cloud service has not started.
//
// - 1: The cloud service initialization is complete.
//
// - 2: The cloud service components are starting.
//
// - 3: Some cloud service components are ready.
//
// - 4: All cloud service components are ready.
//
// - 5: The cloud service is in progress.
//
// - 6: The cloud service receives the request to stop.
//
// - 7: All components of the cloud service stop.
//
// - 8: The cloud service exits.
//
// - 20: The cloud service exits abnormally.
Status int `json:"status"`
// The data format of the fileList field:
//
// - "string": fileList is of String type. In composite recording mode,
// if avFileType is set to ["hls"], fileListMode is "string".
//
// - "json": fileList is a JSON Array. When avFileType is set to ["hls","mp4"]
// in the individual or composite recording mode, fileListMode is set to "json".
FileListMode string `json:"fileListMode"`
// The file list.
FileList string `json:"fileList"`
// The recording start time of the file, the Unix timestamp, in seconds.
SliceStartTime int64 `json:"sliceStartTime"`
}
@brief Server response returned by the mix recording QueryHLS API.
@since v0.8.0
type QueryResp ¶
type QueryResp struct {
Response
SuccessResponse QuerySuccessResp
}
type QueryRespServerResponseMode ¶
type QueryRespServerResponseMode int
const ( QueryServerResponseUnknownMode QueryRespServerResponseMode = iota QueryIndividualRecordingServerResponseMode QueryIndividualVideoScreenshotServerResponseMode QueryMixRecordingHlsServerResponseMode QueryMixRecordingHlsAndMp4ServerResponseMode QueryWebRecordingServerResponseMode QueryRtmpPublishServerResponseMode )
type QueryRtmpPublishServerResponse ¶ added in v0.8.0
type QueryRtmpPublishServerResponse struct {
// Current status of the cloud service:
//
// - 0: Cloud service has not started.
//
// - 1: The cloud service initialization is complete.
//
// - 2: The cloud service components are starting.
//
// - 3: Some cloud service components are ready.
//
// - 4: All cloud service components are ready.
//
// - 5: The cloud service is in progress.
//
// - 6: The cloud service receives the request to stop.
//
// - 7: All components of the cloud service stop.
//
// - 8: The cloud service exits.
//
// - 20: The cloud service exits abnormally.
Status int `json:"status"`
// Extension service state
ExtensionServiceState []struct {
// Extension service payload
Payload struct {
// The status of uploading subscription content to the extension service:
//
// - "init": The service is initializing.
//
// - "inProgress": The service has started and is currently in progress.
//
// - "exit": Service exits.
State string `json:"state"`
// The push stream to the CDN output.
Outputs []struct {
// The CDN address to which you push the stream.
RtmpUrl string `json:"rtmpUrl"`
// The current status of stream pushing of the web page recording:
//
// - "connecting": Connecting to the CDN server.
//
// - "publishing": The stream pushing is going on.
//
// - "onhold": Set whether to pause the stream pushing.
//
// - "disconnected": Failed to connect to the CDN server. Agora recommends that you change the CDN address to push the stream.
Status string `json:"status"`
} `json:"outputs"`
} `json:"payload"`
// Name of the extended service:
//
// - "web_recorder_service": Represents the extended service is web page recording.
//
// - "rtmp_publish_service": Represents the extended service is to push web page recording to the CDN.
ServiceName string `json:"serviceName"`
} `json:"extensionServiceState"`
}
@brief Server response returned by the web recording QueryRtmpPublish API.
@since v0.8.0
type QuerySuccessResp ¶
type QuerySuccessResp struct {
ResourceId string `json:"resourceId"`
Sid string `json:"sid"`
// contains filtered or unexported fields
}
func (*QuerySuccessResp) GetIndividualRecordingServerResponse ¶
func (q *QuerySuccessResp) GetIndividualRecordingServerResponse() *QueryIndividualRecordingServerResponse
func (*QuerySuccessResp) GetIndividualVideoScreenshotServerResponse ¶
func (q *QuerySuccessResp) GetIndividualVideoScreenshotServerResponse() *QueryIndividualVideoScreenshotServerResponse
func (*QuerySuccessResp) GetMixRecordingHLSAndMP4ServerResponse ¶
func (q *QuerySuccessResp) GetMixRecordingHLSAndMP4ServerResponse() *QueryMixRecordingHLSAndMP4ServerResponse
func (*QuerySuccessResp) GetMixRecordingHLSServerResponse ¶
func (q *QuerySuccessResp) GetMixRecordingHLSServerResponse() *QueryMixRecordingHLSServerResponse
func (*QuerySuccessResp) GetRtmpPublishServiceServerResponse ¶ added in v0.8.0
func (q *QuerySuccessResp) GetRtmpPublishServiceServerResponse() *QueryRtmpPublishServerResponse
func (*QuerySuccessResp) GetServerResponseMode ¶
func (q *QuerySuccessResp) GetServerResponseMode() QueryRespServerResponseMode
func (*QuerySuccessResp) GetWebRecording2CDNServerResponse ¶
func (q *QuerySuccessResp) GetWebRecording2CDNServerResponse() *QueryWebRecordingServerResponse
type QueryWebRecordingServerResponse ¶
type QueryWebRecordingServerResponse struct {
// Current status of the cloud service:
//
// - 0: Cloud service has not started.
//
// - 1: The cloud service initialization is complete.
//
// - 2: The cloud service components are starting.
//
// - 3: Some cloud service components are ready.
//
// - 4: All cloud service components are ready.
//
// - 5: The cloud service is in progress.
//
// - 6: The cloud service receives the request to stop.
//
// - 7: All components of the cloud service stop.
//
// - 8: The cloud service exits.
//
// - 20: The cloud service exits abnormally.
Status int `json:"status"`
// Extension service state
ExtensionServiceState []struct {
// Extension service payload
Payload struct {
// File list
FileList []struct {
// The file names of the M3U8 and MP4 files generated during recording.
Filename string `json:"filename"`
// The recording start time of the file, the Unix timestamp, in seconds.
SliceStartTime int64 `json:"sliceStartTime"`
} `json:"fileList"`
// Whether the page recording is in pause state:
//
// - true: In pause state.
//
// - false: The page recording is running.
Onhold bool `json:"onhold"`
// The status of uploading subscription content to the extension service:
//
// - "init": The service is initializing.
//
// - "inProgress": The service has started and is currently in progress.
//
// - "exit": Service exits.
State string `json:"state"`
// The status of the push stream to the CDN.
Outputs []struct {
// The CDN address to which you push the stream.
RtmpUrl string `json:"rtmpUrl"`
// The current status of stream pushing of the web page recording:
//
// - "connecting": Connecting to the CDN server.
//
// - "publishing": The stream pushing is going on.
//
// - "onhold": Set whether to pause the stream pushing.
//
// - "disconnected": Failed to connect to the CDN server. Agora recommends that you change the CDN address to push the stream.
Status string `json:"status"`
} `json:"outputs"`
} `json:"payload"`
// Name of the extended service:
//
// - "web_recorder_service": Represents the extended service is web page recording.
//
// - "rtmp_publish_service": Represents the extended service is to push web page recording to the CDN.
ServiceName string `json:"serviceName"`
} `json:"extensionServiceState"`
}
@brief Server response returned by the web recording Query API.
@since v0.8.0
type RecordingConfig ¶
type RecordingConfig struct {
// The channel type.(Required)
//
// The channel type can be set to:
//
// - 0: The communication use-case (Default)
// - 1: Live streaming scene
ChannelType int `json:"channelType"`
// Subscribed media stream type.(Optional)
//
// The stream type can be set to:
// - 0: Subscribes to audio streams only. Suitable for smart voice review use-cases.
// - 1: Subscribes to video streams only.
// - 2: Subscribes to both audio and video streams.(Default)
StreamTypes int `json:"streamTypes"`
// Output mode of media stream.(Optional)
//
// The stream mode can be set to:
//
// - "default": Default mode.
// Recording with audio transcoding will separately generate an M3U8 audio index file and a video index file.
// - "standard": Standard mode. Agora recommends using this mode.
// Recording with audio transcoding will separately generate an M3U8 audio index file, a video index file,
// and a merged audio and video index file. If VP8 encoding is used on the Web client, a merged MPD audio-video index file will be generated.
// - "original": Original encoding mode. It is applicable to individual non-transcoding audio recording.
// This field only takes effect when subscribing to audio only (streamTypes is 0).
// During the recording process, the audio is not transcoded, and an M3U8 audio index file is generated.
StreamMode string `json:"streamMode,omitempty"`
// The decryption mode.(Optional)
//
// If you have set channel encryption in the SDK client,
// you need to set the same decryption mode for the cloud recording service.
//
// The decryption mode can be set to:
//
// - 0: Not encrypted.(Default)
// - 1: AES_128_XTS encryption mode. 128-bit AES encryption, XTS mode.
// - 2: AES_128_ECB encryption mode. 128-bit AES encryption, ECB mode.
// - 3: AES_256_XTS encryption mode. 256-bit AES encryption, XTS mode.
// - 4: SM4_128_ECB encryption mode. 128-bit SM4 encryption, ECB mode.
// - 5: AES_128_GCM encryption mode. 128-bit AES encryption, GCM mode.
// - 6: AES_256_GCM encryption mode. 256-bit AES encryption, GCM mode.
// - 7: AES_128_GCM2 encryption mode. 128-bit AES encryption, GCM mode.
// Compared to AES_128_GCM encryption mode, AES_128_GCM2 encryption mode has higher security and requires setting a key and salt.
// - 8: AES_256_GCM2 encryption mode. 256-bit AES encryption, GCM mode.
// Compared to the AES_256_GCM encryption mode, the AES_256_GCM2 encryption mode is more secure and requires setting a key and salt.
DecryptionMode int `json:"decryptionMode,omitempty"`
// Keys related to encryption and decryption.(Optional)
//
// Only needs to be set when decryptionMode is not 0.
Secret string `json:"secret,omitempty"`
// Salt related to encryption and decryption.(Optional)
//
// Base64 encoding, 32-bit bytes.
//
// Only need to set when decryptionMode is 7 or 8.
Salt string `json:"salt,omitempty"`
// Set the sampling rate, bitrate, encoding mode, and number of channels for the output audio.(Optional)
//
// The audio profile can be set to:
//
// - 0: 48 kHz sampling rate, music encoding, mono audio channel, and the encoding bitrate is about 48 Kbps.(Default)
// - 1: 48 kHz sampling rate, music encoding, mono audio channel, and the encoding bitrate is approximately 128 Kbps.
// - 2: 48 kHz sampling rate, music encoding, stereo audio channel, and the encoding bitrate is approximately 192 Kbps.
AudioProfile int `json:"audioProfile,omitempty"`
// Sets the stream type of the remote video.(Optional)
//
// If you enable dual-stream mode in the SDK client,
// you can choose to subscribe to either the high-quality video stream or the low-quality video stream.
//
// The video stream type can be set to:
//
// - 0: High-quality video stream refers to high-resolution and high-bitrate video stream.(Default)
// - 1: Low-quality video stream refers to low-resolution and low-bitrate video stream.
VideoStreamType int `json:"videoStreamType,omitempty"`
// Maximum channel idle time.(Optional)
//
// The unit is seconds.
//
// The value range is [5,259200].
//
// The default value is 30.
MaxIdleTime int `json:"maxIdleTime,omitempty"`
// Configurations for transcoded video output.(Optional)
TranscodingConfig *TranscodingConfig `json:"transcodingConfig,omitempty"`
// Specify which UIDs' audio streams to subscribe to.(Optional)
//
// If you want to subscribe to the audio stream of all UIDs, no need to set this field.
SubscribeAudioUIDs []string `json:"subscribeAudioUids,omitempty"`
// Specify which UIDs' audio streams not to subscribe to.(Optional)
//
// The cloud recording service will subscribe to the audio streams of all other UIDs except the specified ones.
UnsubscribeAudioUIDs []string `json:"unSubscribeAudioUids,omitempty"`
// Specify which UIDs' video streams to subscribe to.(Optional)
//
// If you want to subscribe to the video streams of all UIDs, no need to set this field.
SubscribeVideoUIDs []string `json:"subscribeVideoUids,omitempty"`
// Specify which UIDs' video streams not to subscribe to.(Optional)
//
// The cloud recording service will subscribe to the video streams of all UIDs except the specified ones.
UnsubscribeVideoUIDs []string `json:"unSubscribeVideoUids,omitempty"`
// Estimated peak number of subscribers.(Optional)
//
// The subscription group can be set to:
// - 0: 1 to 2 UIDs.
// - 1: 3 to 7 UIDs.
// - 2: 8 to 12 UIDs
// - 3: 13 to 17 UIDs
// - 4: 18 to 32 UIDs.
// - 5: 33 to 49 UIDs.
SubscribeUidGroup int `json:"subscribeUidGroup,omitempty"`
}
@brief Configuration for recorded audio and video streams.
@since v0.8.0
type RecordingFileConfig ¶
type RecordingFileConfig struct {
// Type of video files generated by recording.(Optional)
//
// The file type can be set to:
//
// - "hls": default value. M3U8 and TS files.
// - "mp4": MP4 files.
AvFileType []string `json:"avFileType"`
}
@brief Configuration for the recorded files.
@since v0.8.0
type Response ¶
type Response struct {
// HTTP base response, see agora.BaseResponse for details
*agora.BaseResponse
// Error response, see ErrResponse for details
ErrResponse ErrResponse
}
@brief Response returned by the cloud recording API.
@since v0.8.0
func (Response) IsSuccess ¶
@brief Determines whether the response returned by the cloud recording API is successful.
@note If the response is successful, continue to read the data in the successful response; otherwise, read the data in the error response
@return Returns true if successful, otherwise false
@since v0.8.0
type RtmpPublishServiceParam ¶
type RtmpPublishServiceParam struct {
// The array of CDN addresses to which you push the stream.(Required)
Outputs []Outputs `json:"outputs,omitempty"`
}
@brief Service parameter configuration for pushing web page recording to the CDN.
@since v0.8.0
func (*RtmpPublishServiceParam) ServiceParam ¶
func (r *RtmpPublishServiceParam) ServiceParam()
type ServiceParamInterface ¶
type ServiceParamInterface interface {
ServiceParam()
}
type SnapshotConfig ¶
type SnapshotConfig struct {
// The cycle for regular screenshots in the cloud recording.(Optional)
//
// The unit is seconds.
//
// The value range is [5,3600].
//
// The default value is 10.
CaptureInterval int `json:"captureInterval,omitempty"`
// The file format of screenshots.
//
// Currently only ["jpg"] is supported, which generates screenshot files in JPG format.
FileType []string `json:"fileType"`
}
@brief Configuration for screenshot capture.
@since v0.8.0
type StartClientRequest ¶
type StartClientRequest struct {
Token string `json:"token,omitempty"`
RecordingConfig *RecordingConfig `json:"recordingConfig,omitempty"`
RecordingFileConfig *RecordingFileConfig `json:"recordingFileConfig,omitempty"`
SnapshotConfig *SnapshotConfig `json:"snapshotConfig,omitempty"`
StorageConfig *StorageConfig `json:"storageConfig,omitempty"`
ExtensionServiceConfig *ExtensionServiceConfig `json:"extensionServiceConfig,omitempty"`
}
type StartReqBody ¶
type StartReqBody struct {
Cname string `json:"cname"`
Uid string `json:"uid"`
ClientRequest *StartClientRequest `json:"clientRequest"`
}
type StartResp ¶
type StartResp struct {
// Response returned by the cloud recording API, see Response for details
Response
// Successful response, see StartSuccessResp for details
SuccessResponse StartSuccessResp
}
@brief StartResp returned by the various of cloud recording scenarios Start API.
@since v0.8.0
type StartSuccessResp ¶
type StartSuccessResp struct {
// Channel name
Cname string `json:"cname"`
// User ID
UID string `json:"uid"`
// Unique identifier of the resource
ResourceId string `json:"resourceId"`
// Unique identifier of the recording session
Sid string `json:"sid"`
}
@brief Successful response returned by the various of cloud recording scenarios Start API.
@since v0.8.0
type StopClientRequest ¶
type StopClientRequest struct {
AsyncStop bool `json:"async_stop"`
}
StopClientRequest is the request body of stop.
type StopReqBody ¶
type StopReqBody struct {
Cname string `json:"cname"`
Uid string `json:"uid"`
ClientRequest *StopClientRequest `json:"clientRequest"`
}
type StopResp ¶
type StopResp struct {
// Response returned by the cloud recording API, see Response for details
Response
// Successful response, see StopSuccessResp for details
SuccessResponse StopSuccessResp
}
@brief StopResp returned by the various of cloud recording scenarios Stop API.
@since v0.8.0
type StopRespServerResponseMode ¶
type StopRespServerResponseMode int
const ( StopServerResponseUnknownMode StopRespServerResponseMode = iota StopIndividualRecordingServerResponseMode StopIndividualVideoScreenshotServerResponseMode StopMixRecordingHlsServerResponseMode StopMixRecordingHlsAndMp4ServerResponseMode StopWebRecordingServerResponseMode )
type StopSuccessResp ¶
type StopSuccessResp struct {
// Name of the channel to be recorded
Cname string `json:"cname"`
// User ID used by the cloud recording service in the RTC channel to identify the recording service in the channel
UID string `json:"uid"`
// Unique identifier of the resource
ResourceId string `json:"resourceId"`
// Unique identifier of the recording session
Sid string `json:"sid"`
}
@brief Successful response returned by the various of cloud recording scenarios Stop API.
@since v0.8.0
type StorageConfig ¶
type StorageConfig struct {
// Third-party cloud storage platforms.(Required)
//
// The vendor can be set to:
//
// - 1: Amazon S3
// - 2: Alibaba Cloud
// - 3: Tencent Cloud
// - 5: Microsoft Azure
// - 6: Google Cloud
// - 7: Huawei Cloud
// - 8: Baidu IntelligentCloud
// - 11: Self-built cloud storage
Vendor int `json:"vendor"`
// The region information specified for the third-party cloud storage.(Required)
Region int `json:"region"`
// Third-party cloud storage bucket.(Required)
Bucket string `json:"bucket"`
// The access key of third-party cloud storage.(Required)
AccessKey string `json:"accessKey"`
// A temporary security token for third-party cloud storage.
// This token is issued by the cloud service provider's Security Token Service (STS) and used to grant limited access rights to third-party cloud storage resources.
//
// Currently supported cloud service providers include only the following:
//
// - 1: Amazon S3
// - 2: Alibaba Cloud
// - 3: Tencent Cloud.
StsToken string `json:"stsToken,omitempty"`
// The stsToken expiration timestamp used to mark UNIX time, in seconds.(Optional)
StsExpiration int `json:"stsExpiration,omitempty"`
// The secret key of third-party cloud storage.(Required)
SecretKey string `json:"secretKey"`
// The storage location of the recorded files in the third-party cloud is related to the prefix of the file name.(Optional)
FileNamePrefix []string `json:"fileNamePrefix,omitempty"`
// Third-party cloud storage services will encrypt and tag the uploaded recording files according to this field.(Optional)
ExtensionParams *ExtensionParams `json:"extensionParams,omitempty"`
}
@brief Configuration for third-party cloud storage.
@since v0.8.0
type TranscodingConfig ¶
type TranscodingConfig struct {
// The width of the video (pixels).(Optional)
//
// Width × Height cannot exceed 1920 × 1080.
//
// The default value is 360.
Width int `json:"width,omitempty"`
// The height of the video (pixels).(Optional)
//
// width × height cannot exceed 1920 × 1080.
//
// The default value is 640.
Height int `json:"height,omitempty"`
// The frame rate of the video (fps).(Optional)
//
// The default value is 15.
FPS int `json:"fps,omitempty"`
// The bitrate of the video (Kbps).(Optional)
//
// The default value is 1500.
BitRate int `json:"bitrate,omitempty"`
// Only need to set it in vertical layout.(Optional)
//
// Specify the user ID of the large video window.
MaxResolutionUid string `json:"maxResolutionUid,omitempty"`
// Composite video layout.(Optional)
//
// The video layout can be set to:
//
// - 0: Floating layout(Default).
// The first user to join the channel will be displayed as a large window, filling the entire canvas.
// The video windows of other users will be displayed as small windows, arranged horizontally from bottom to top,
// up to 4 rows, each with 4 windows. It supports up to a total of 17 windows of different users' videos.
// - 1: Adaptive layout.
// Automatically adjust the size of each user's video window according to the number of users,
// each user's video window size is consistent, and supports up to 17 windows.
// - 2: Vertical layout.
// The maxResolutionUid is specified to display the large video window on the left side of the screen,
// and the small video windows of other users are vertically arranged on the right side,
// with a maximum of two columns, 8 windows per column, supporting up to 17 windows.
// - 3: Customized layout.
// Set the layoutConfig field to customize the mixed layout.
MixedVideoLayout int `json:"mixedVideoLayout,omitempty"`
// The background color of the video canvas.(Optional)
//
// The RGB color table is supported, with strings formatted as a # sign and 6 hexadecimal digits.
//
// The default value is "#000000", representing the black color.
BackgroundColor string `json:"backgroundColor,omitempty"`
// The URL of the background image of the video canvas.(Optional)
//
// The display mode of the background image is set to cropped mode.
//
// Cropped mode: Will prioritize to ensure that the screen is filled.
// The background image size is scaled in equal proportion until the entire screen is filled with the background image.
// If the length and width of the background image differ from the video window,
// the background image will be peripherally cropped to fill the window.
BackgroundImage string `json:"backgroundImage,omitempty"`
// The URL of the default user screen background image.(Optional)
DefaultUserBackgroundImage string `json:"defaultUserBackgroundImage,omitempty"`
// Configurations of user's layout.(Optional)
LayoutConfig []LayoutConfig `json:"layoutConfig,omitempty"`
// Configurations of user's background image.(Optional)
BackgroundConfig []BackgroundConfig `json:"backgroundConfig,omitempty"`
}
@brief Configurations for transcoded video output.
@since v0.8.0
type UpdateAudioUIDList ¶
type UpdateAudioUIDList struct {
// Specify which UIDs' audio streams to subscribe to.
//
// If you want to subscribe to the audio stream of all UIDs, no need to set this field.
//
// Set as ["#allstream#"] to subscribe to the audio streams of all UIDs in the channel.
SubscribeAudioUIDs []string `json:"subscribeAudioUids,omitempty"`
// Specify which UIDs' audio streams not to subscribe to.
//
// The cloud recording service will subscribe to the audio streams of all other UIDs except the specified ones.
UnsubscribeAudioUIDs []string `json:"unSubscribeAudioUids,omitempty"`
}
@brief Update audio subscription list.
@since v0.8.0
type UpdateClientRequest ¶
type UpdateClientRequest struct {
StreamSubscribe *UpdateStreamSubscribe `json:"streamSubscribe,omitempty"`
WebRecordingConfig *UpdateWebRecordingConfig `json:"webRecordingConfig,omitempty"`
RtmpPublishConfig *UpdateRtmpPublishConfig `json:"rtmpPublishConfig,omitempty"`
}
type UpdateLayout ¶
type UpdateLayout struct {
// contains filtered or unexported fields
}
func NewUpdateLayout ¶
func (*UpdateLayout) Do ¶
func (u *UpdateLayout) Do(ctx context.Context, resourceID string, sid string, mode string, payload *UpdateLayoutReqBody) (*UpdateLayoutResp, error)
type UpdateLayoutClientRequest ¶
type UpdateLayoutClientRequest struct {
MaxResolutionUID string `json:"maxResolutionUid,omitempty"`
MixedVideoLayout int `json:"mixedVideoLayout"`
BackgroundColor string `json:"backgroundColor,omitempty"`
BackgroundImage string `json:"backgroundImage,omitempty"`
DefaultUserBackgroundImage string `json:"defaultUserBackgroundImage,omitempty"`
LayoutConfig []UpdateLayoutConfig `json:"layoutConfig,omitempty"`
BackgroundConfig []BackgroundConfig `json:"backgroundConfig,omitempty"`
}
type UpdateLayoutConfig ¶
type UpdateLayoutConfig struct {
// The content of the string is the UID of the user to be displayed in the area, 32-bit unsigned integer.(Optional)
//
// If the UID is not specified, the screen settings in layoutConfig will be matched automatically in the order that users join the channel.
UID string `json:"uid"`
// The relative value of the horizontal coordinate of the upper-left corner of the screen, accurate to six decimal places.(Required)
//
// Layout from left to right, with 0.0 at the far left and 1.0 at the far right.
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
XAxis float32 `json:"x_axis"`
// The relative value of the vertical coordinate of the upper-left corner of this screen in the screen, accurate to six decimal places.(Required)
//
// Layout from top to bottom, with 0.0 at the top and 1.0 at the bottom.
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
YAxis float32 `json:"y_axis"`
// The relative value of the width of this screen, accurate to six decimal places.(Required)
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
Width float32 `json:"width"`
// The relative value of the height of this screen, accurate to six decimal places.(Required)
//
// This field can also be set to the integer 0 or 1.
//
// The value range is [0,1].
Height float32 `json:"height"`
// The transparency of the user's video window.(Optional)
//
// Accurate to six decimal places.
//
// 0.0 means the user's video window is transparent, and 1.0 indicates that it is completely opaque.
//
// The value range is [0,1].
//
// The default value is 1.
Alpha float32 `json:"alpha"`
// The display mode of users' video windows.(Optional)
//
// The value can be set to:
//
// - 0: cropped mode.(Default)
// Prioritize to ensure the screen is filled.
// The video window size is proportionally scaled until it fills the screen.
// If the video's length and width differ from the video window,
// the video stream will be cropped from its edges to fit the window, under the aspect ratio set for the video window.
// - 1: Fit mode.
// Prioritize to ensure that all video content is displayed.
// The video size is scaled proportionally until one side of the video window is aligned with the screen border.
// If the video scale does not comply with the window size, the video will be scaled to fill the screen while maintaining its aspect ratio.
// This scaling may result in a black border around the edges of the video.
RenderMode int `json:"render_mode"`
}
@brief The layout configuration.
@since v0.8.0
type UpdateLayoutReqBody ¶
type UpdateLayoutReqBody struct {
Cname string `json:"cname"`
Uid string `json:"uid"`
ClientRequest *UpdateLayoutClientRequest `json:"clientRequest"`
}
type UpdateLayoutResp ¶
type UpdateLayoutResp struct {
// Response returned by the cloud recording API, see Response for details
Response
// Success response, see UpdateLayoutSuccessResp for details
SuccessResponse UpdateLayoutSuccessResp
}
@brief Response returned by the cloud recording UpdateLayout API.
@since v0.8.0
type UpdateLayoutSuccessResp ¶
type UpdateLayoutSuccessResp struct {
// Unique identifier of the resource
ResourceId string `json:"resourceId"`
// Unique identifier of the recording session
Sid string `json:"sid"`
}
@brief Successful response returned by the cloud recording UpdateLayout API.
@since v0.8.0
type UpdateOutput ¶
type UpdateOutput struct {
// The CDN URL where you push the stream to.(Optional)
RtmpURL string `json:"rtmpUrl"`
}
@brief The CDN URL where you push the stream to.
@since v0.8.0
type UpdateReqBody ¶
type UpdateReqBody struct {
Cname string `json:"cname"`
Uid string `json:"uid"`
ClientRequest *UpdateClientRequest `json:"clientRequest"`
}
type UpdateResp ¶
type UpdateResp struct {
// Response returned by the cloud recording API, see Response for details
Response
// Successful response, see UpdateSuccessResp for details
SuccessResponse UpdateSuccessResp
}
@brief UpdateResp returned by the various of cloud recording scenarios Update API.
type UpdateRtmpPublishConfig ¶
type UpdateRtmpPublishConfig struct {
// The array of CDN URL where you push the stream to.(Optional)
Outputs []UpdateOutput `json:"outputs"`
}
@brief Used to update the configurations for pushing web page recording to the CDN.
@since v0.8.0
type UpdateStreamSubscribe ¶
type UpdateStreamSubscribe struct {
// The audio subscription list.(Optional)
AudioUidList *UpdateAudioUIDList `json:"audioUidList,omitempty"`
// The video subscription list.(Optional)
VideoUidList *UpdateVideoUIDList `json:"videoUidList,omitempty"`
}
@brief Update subscription lists.
@since v0.8.0
type UpdateSuccessResp ¶
type UpdateSuccessResp struct {
// Unique identifier of the resource
ResourceId string `json:"resourceId"`
// Unique identifier of the recording session
Sid string `json:"sid"`
// User ID used by the cloud recording service in the RTC channel to identify the recording service in the channel
UID string `json:"uid"`
// Name of the channel to be recorded
Cname string `json:"cname"`
}
@brief Successful response returned by the various of cloud recording scenarios Update API.
type UpdateVideoUIDList ¶
type UpdateVideoUIDList struct {
// Specify which UIDs' video streams to subscribe to.
//
// If you want to subscribe to the video stream of all UIDs, no need to set this field.
//
// Set as ["#allstream#"] to subscribe to the video streams of all UIDs in the channel.
SubscribeVideoUIDs []string `json:"subscribeVideoUids,omitempty"`
// Specify which UIDs' video streams not to subscribe to.
//
// The cloud recording service will subscribe to the video streams of all other UIDs except the specified ones.
UnsubscribeVideoUIDs []string `json:"unSubscribeVideoUids,omitempty"`
}
@brief Update video subscription list.
@since v0.8.0
type UpdateWebRecordingConfig ¶
type UpdateWebRecordingConfig struct {
// Set whether to pause the web page recording.(Optional)
//
// - true: Pauses web page recording and generating recording files.
// - false: Continues web page recording and generates recording files.(Default)
Onhold bool `json:"onhold"`
}
@brief Used to update the web page recording configurations
@since v0.8.0
type WebRecordingServiceParam ¶
type WebRecordingServiceParam struct {
// The address of the page to be recorded.(Required)
URL string `json:"url"`
// The bitrate of the output video (Kbps).(Optional)
//
// For different output video resolutions, the default value of videoBitrate is different:
//
// - Output video resolution is greater than or equal to 1280 × 720, and the default value is 2000.
// - Output video resolution is less than 1280 × 720, and the default value is 1500.
VideoBitRate int `json:"VideoBitrate,omitempty"`
// The frame rate of the output video (fps).(Optional)
//
// The value range is [5,60].
//
// The default value is 15.
VideoFPS int `json:"videoFps,omitempty"`
// Sampling rate, bitrate, encoding mode, and number of channels for the audio output.(Required)
//
// The audio profile can be set to:
//
// - 0: 48 kHz sampling rate, music encoding, mono audio channel, and the encoding bitrate is approximately 48 Kbps.
// - 1: 48 kHz sampling rate, music encoding, mono audio channel, and the encoding bitrate is approximately 128 Kbps.
// - 2: 48 kHz sampling rate, music encoding, stereo audio channel, and the encoding bitrate is approximately 192 Kbps.
AudioProfile int `json:"audioProfile"`
// Whether to enable the mobile web mode.(Optional)
//
// - true: Enables the mode. After enabling,
// the recording service uses the mobile web rendering mode to record the current page.
// - false: Disables the mode.(Default)
Mobile bool `json:"mobile,omitempty"`
// The output video width (pixel).(Required)
//
// The product of videoWidth and videoHeight should be less than or equal to 1920 × 1080.
VideoWidth int `json:"videoWidth"`
// The output video height (pixel).(Required)
//
// The product of videoWidth and videoHeight should be less than or equal to 1920 × 1080.
VideoHeight int `json:"videoHeight"`
// The maximum duration of web page recording (hours). (Required)
//
// The web page recording will automatically stop after exceeding this value.
//
// The value range is [1,720].
MaxRecordingHour int `json:"maxRecordingHour"`
// Maximum length of MP4 slice file generated by web page recording, in minutes.(Optional)
//
// During the web page recording process,
// the recording service will create a new MP4 slice file when the current MP4 file
// duration exceeds the maxVideoDuration approximately.
//
// The value range is [30,240].
//
// The default value is 120.
MaxVideoDuration int `json:"maxVideoDuration,omitempty"`
// Whether to pause page recording when starting a web page recording task.(Optional)
//
// - true: Pauses the web page recording that has been started.
// Immediately pause the recording after starting the web page recording task.
// The recording service will open and render the page to be recorded, but will not generate slice files.
// - false: Starts a web page recording task and performs web page recording.(Default)
Onhold bool `json:"onhold"`
// Set the page load timeout in seconds.(Optional)
//
// The value range is [0,60].
//
// The default value is 0.
ReadyTimeout int `json:"readyTimeout"`
}
@brief Service parameter configuration for web page recording.
@since v0.8.0
func (*WebRecordingServiceParam) ServiceParam ¶
func (w *WebRecordingServiceParam) ServiceParam()