Contains the configuration of the s17 server and the player configuration, which takes effect on all player instances created by StPlayer. This configuration item must be configured before instantiation
Instructions
playerjs.config = { ...customConfig };
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
ip | String | Yes | s17 Media Service IP | |
port | Number | Yes | s17 media service port | |
httpProtocol | String | Yes | http protocol type: http, https | |
baseURL | String | Yes | Custom request prefix, including at least protocol, ip, port, such as: https://test-2100.xxxxx.com:20551/getway. When configuring this item, ignore the previous ip. port, httpProtocol and other configurations ** (recommended to use this field) ** | |
decoderType | String | 1 | No | Decoding type, 0: wasm, 1: mse, 2: webCodecs (new in 1.5). (If the browser does not support h265 video, it will be forced to use wasm) 1.4.0 or above. When setting this parameter, use Number |
mediaProtocol | String | No | Video streaming protocol: 'HTTP_FLV', 'WS_FLV', not configured or empty, it will be automatically configured in the sdk ('WS_FLV' is preferred) | |
seekTimeout | number | 60 | No | 1. seek timeout duration, unit: seconds. During playback, it is used to detect whether seek times out; 2. Loading timeout duration, unit: seconds. During passthrough and playback, it is used to detect whether loading times out. |
logLevel | Number | 3 | No | Log level, 0-4, from low to high |
describe
When the video contains mosaic information and needs to be displayed. It can block some key images, such as faces, etc.
Configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
mosaic | Number | 0 | No | Whether to mosaic: 0-no coding, 1-plug-in coding, 2-front-end coding. |
mosaicType | Number | 0 | No | 0: blur effect; 1: mosaic |
Example
describe
ADAS overlay information display, including lane lines, alarm signs, vehicle signs, pedestrian signs, current speed, distance information of the vehicle in front, etc.
DMS overlay information display, including driver's phone call, driver's distracted driving, and not wearing seat belt warning sign display.
AEB information acquisition, mainly including forward collision and other information, is used to overlay OSD
Bucket information display, mainly showing the position of the bucket teeth in the excavator bucket, used to determine whether the bucket teeth are missing
Configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
adas | Boolean | false | No | Whether to enable adas information display |
dms | Boolean | false | No | Whether to enable alarm dms information display |
aeb | Boolean | false | No | Whether to enable aeb alarm information |
bucket | Boolean | false | No | Whether to enable bucket information display |
Example
describe
The placeholder plug-in can help when playing back the playback process. When the channel is in no-stream playback state, it can use custom placeholder images or text to implement video placeholder prompts.
Configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
placeholder | Boolean | No | Whether to enable no video placeholder mask |
Example
describe
When the device is abnormally disconnected due to network fluctuations, this configuration can be used to trigger automatic reconnection.
Configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
reconnection | Number/boolean or{ timeInterval: number, maxRetries: number } | Reconnection interval: 20 (0~20)Unlimited number of reconnections (Infinity) | No | Direct disconnection reconnection configuration; < br />Turn off automatic reconnection: 0 or false or timeInterval: 0 or maxRetries: 0; number of reconnections maxRetries: 0,1,2,3...Infinity |
Example
describe
Allow users to customize the video screen ratio
Configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
aspectRatio | String | Full | No | Playback screen ratio, full: full, origin: original ratio, ratio mode, such as: 16:9, 4:3, 1:1 |
Example
describe
In the case of playback, the playback progress return interval and format allow settings
Configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
timeHookInterval | Number | 500 | No | The push frequency of the playback time callback onTimeChange hook, unit ms, >= 40ms |
timeFormatter | String | YYYY-MM-DD HH:mm:ss | No | Time format of time callback Hook |
Example
describe
When the network is poor, users want to cache for a period of time before starting to play, so as to ensure smooth playback.
Configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
needStartBuffer | Boolean | false | No | Whether the first frame buffer is needed, used for playback of very short evidence or when the network is not very good |
bufferTime | Number | 4 | No | Start buffering time, in seconds. Buffering will end only after the buffer amount reaches this value in the first frame or after channel lag. Suggest setting it to be greater than 0 seconds |
Example
playerjs.defaultHeaders configuration item. When the media service requires authentication, this configuration item must be configured. The specific parameters depend on the media service interface.
Instructions
Basic configuration items
Name | Type | Default value | Is it required | Description |
---|---|---|---|---|
_tenantId | Number | 2 | No | Tenant Id, optional parameter (required for S17 cloud service) |
_appId | Number | 1 | No | Application Id, optional parameters (required for S17 cloud service) |
_token | String | No | token | |
_sign | String | No | sign |
In addition, custom request headers are allowed
H5Player supporting version loader is used for asynchronous loading, quick SDK switching, and avoid SDK version conflicts. It is a compressed js that can be used as a project static resource or stored in the server and loaded and retrieved. After the project is loaded successfully, the version loader will add the object of videoSDKVM to the global window. All subsequent loading, switching, etc. of H5Player require the implementation of the channel object.
Note: Internal projects recommend using this manager to load H5Player
Attributes
method
Loading time
It is recommended to preload when entering the video playback page.
Example