Main Entry (HWLLSPlayer)
This section describes the HWLLSPlayer APIs of the LLL Web SDK.
API |
Description |
---|---|
Checks whether the browser supports the LLL Web SDK. |
|
Obtains the SDK version number. |
|
Creates a client object for pulling live streams. If multiple live streams need to be pulled, you need to create multiple client objects. |
|
Uploads logs. |
|
Saves logs. |
|
Configures global parameters. |
|
Sets the level of logs to be printed on the console. |
checkSystemRequirements
checkSystemRequirements(): Promise<boolean>
[Function Description]
Checks whether the browser supports the LLL Web SDK.
[Request Parameters]
None
[Response Parameters]
Promise<boolean>: A Promise object is returned. The value true indicates that the browser is compatible with the LLL Web SDK. If they are incompatible, an error is returned.
![](https://support.huaweicloud.com/intl/en-us/llsdk-live/public_sys-resources/caution_3.0-en-us.png)
LLL requires the WebRTC capability but some browsers may not support WebRTC playback. In this case, you can downgrade the playback based on the specific error code (HWLLS_ERROR_WEBRTC_UNSUPPORTED). For details, see SDK Usage.
getVersion
getVersion(): string
[Function Description]
Obtains the current SDK version number.
[Request Parameters]
None
[Response Parameters]
string: current SDK version number.
createClient
createClient(type: string): HWLLSClient | HWFlvClient | HWHlsClient
[Function Description]
Creates a client object for pulling live streams. If multiple live streams need to be pulled, you need to create multiple client objects.
[Request Parameters]
type: (optional) String type. Indicates the type of the client created for pulling streams.
- Type of the client for pulling LLL streams: webrtc
- Type of the client for pulling FLV streams: flv.
- Type of the client for pulling HLS streams: hls (reserved)
Default value: webrtc
[Response Parameters]
client: client object for pulling streams.
uploadLog
async uploadLog(): Promise<void>
[Function Description]
Uploads logs.
[Request Parameters]
None
[Response Parameters]
Promise<void>: If tryCatch is used to obtain errors as an array, error information corresponding to multiple app IDs will be returned.
saveLog
async saveLog(): Promise<Blob>
[Function Description]
Users can flexibly save logs.
[Request Parameters]
None
[Response Parameters]
Promise<Blob>: Promise<Blob> compressed in .zip format, which can be directly saved as a .zip file.
setParameter
setParameter(parameterKey: string, parameterValue: any): boolean
[Function Description]
Configures global parameters.
[Request Parameters]
Parameter |
Value |
---|---|
LOADING_CONFIG |
LoadingConfig is defined as: { netQualityLoading: (optional) The type is Boolean. true indicates that the loading effect is displayed based on the network quality. The default value is false, indicating that the loading effect is not displayed. netQualityLoadingThreshold: (optional) The type is number. Indicates the threshold of the network-quality for displaying the loading effect. The default network quality level is 5. frameStuckLoading: (optional) The type is Boolean. true indicates that the loading effect is displayed based on the frame freezing duration. The default value is false, indicating that the loading effect is not displayed. frameStuckThreshold: (optional) The type is number. Indicates the frame freezing duration threshold for displaying the loading effect. The unit is 100 ms. The default value is 10, indicating that the frame freezing duration is 1000 ms. }
CAUTION:
You need to configure this parameter before starting playback. |
DNS_QUERY_ENABLE |
Boolean type. true indicates that DNS resolution is enabled. false indicates that DNS resolution is disabled. |
ACCESS_DOMAIN |
String type. By default, this parameter is not specified, is used to configure the stream pull environment, and needs to be set by Huawei engineers. |
GLSB_DOMAIN |
String type. By default, this parameter is not specified, is used to configure the GSLB environment, and needs to be set by Huawei engineers. |
[Response Parameters]
boolean: configuration parameter setting result. true indicates that the setting is successful. false indicates that the setting fails.
setLogLevel
setLogLevel(level: string): boolean
[Function Description]
Set the level of logs to be printed on the console. Otherwise, the default level is error.
[Request Parameters]
level: (mandatory) String type. A log level identifier.
- none: Disables the function of printing logs of all levels.
- error: Logs of the error level are printed.
- warn: Logs of the warn level and higher levels are printed.
- info: Logs of the info level and higher levels are printed.
- debug: Logs of the debug level and higher levels are printed.
[Response Parameters]
boolean: log level setting result. true indicates that the log level is set successfully. false indicates that the log level fails to be set.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot