หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Main Entry (HWLLSPlayer)

Updated on 2025-02-21 GMT+08:00

This section describes the HWLLSPlayer APIs of the LLL web SDK.

Table 1 HRTC APIs

API

Description

checkSystemRequirements

Checks whether the browser supports the LLL web SDK.

getVersion

Obtains the SDK version number.

createClient

Creates a client object for pulling live streams. If multiple live streams need to be pulled, you need to create multiple client objects.

uploadLog

Uploads logs.

saveLog

Saves logs.

setParameter

Configures global parameters.

setLogLevel

Sets the level of logs to be printed on the console.

setReportConfig

Sets the dotting capability and the authentication policy for dotting and log uploading.

on

Registers the callback for a client object event.

off

Deregisters the callback for a client object event.

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.

CAUTION:

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(): HWLLSClient

[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]

None

[Response Parameters]

client: client object for pulling streams.

createClient (Earlier than 2.10.6)

createClient(type: string): HWLLSClient | HWFlvClient | HWHlsClient

[Function Description]

Creates a client object for livestream pull. If multiple livestreams 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 stream pull.

  • 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 created for stream pull

CAUTION:

SDK 2.10.6 and later versions do not support the independent use of the HWFlvClient and HWHlsClient players. If you are using SDK of an earlier version, refer to Client Object (HWFlvClient) and Client Object (HWHlsClient).

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

(Optional) Boolean type. true indicates that DNS resolution is enabled. false (default) indicates that DNS resolution is disabled.

ACCESS_DOMAIN

(Optional) String type. By default, this parameter is not specified and is used to configure the stream pull environment. You need to contact technical support when specifying it.

GLSB_DOMAIN

(Optional) String type. By default, this parameter is not specified and is used to configure the GSLB environment. You need to contact technical support when specifying it.

BACKGROUND_PLAY

(Optional) Boolean type. true indicates that background playback is enabled, and false (default) indicates that background playback is disabled.

AUTO_DOWNGRADE

(Optional) Boolean type. true (default) indicates that automatic downgrade is enabled, and false indicates that automatic downgrade is disabled.

[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.

setReportConfig

setReportConfig(reportConfig:ReportConfig):boolean

[Function Description]

Sets the dotting capability and the authentication policy for dotting and log uploading.

[Request Parameters]

reportConfig: (mandatory) ReportConfig type. reportConfig is defined as follows:

  • enable: (mandatory) The value is of the Boolean type. true (default) indicates that dotting is enabled, and false indicates that dotting is disabled.
  • tokenConfig: (optional) The object definition is as follows:
    • enable: The value is of the Boolean type. true indicates that authentication is enabled, and false (default) indicates that authentication is disabled.
    • tokenInfo: The value is of the array type. The array contains the ReportTokenInfo class. ReportTokenInfo is defined as follows:
      • appid: The value is of the string type.
      • expTimestamp: The value is of the string type, indicating the expiration timestamp. The value is the current UNIX timestamp plus the authentication expiration time. The recommended value is 7200 seconds. The maximum value is 43200 seconds, that is, 12 hours.

        For example, if the current UNIX timestamp is 1708531200 and the authentication expiration time is 7200 seconds, the expiration timestamp is 1708538400, indicating that the verification string expires at 02:00:00 on February 22, 2024.

      • token: The value is of the string type. It is a string generated by hmac_sha256. hmac_sha256 (shared key, expiration timestamp + appID) The shared key is controlled and obtained by the user.

[Response Parameters]

A Boolean value is returned. Returns true if the value is set successfully; returns false otherwise.

If the authentication policy is enabled, the actual request status is obtained by registering the Error callback through the on function.

on

on(event: string, handler: function, withTimeout?: boolean): void

[Function Description]

Registers the callback for a client object event.

[Request Parameters]
  • event: (mandatory) event name, which is of the string type. It is used to register the Error event, listen for dotting, or upload error information in logs.
  • handler: (mandatory) event processing method. The type is function.

    The handler method transfers the errorInfo parameter, which is an object defined as follows:

    {

    code: (mandatory) error code. The type is number.

    message: (mandatory) error description. The type is string.

    appid: (mandatory) error log ID. The type is string.

    }

  • withTimeout: (optional) indicates whether a timeout error is reported. The value is of the Boolean type.

[Response Parameters]

None

off

off(event: string, handler: function): void

[Function Description]

Deregisters the callback for a client object event.

[Request Parameters]
  • event: (mandatory) event name, which is of the string type. It is used to deregister the Error event.
  • handler: (mandatory) event handling method. The type is function.

[Response Parameters]

None

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback