Members
(static, constant) HisPlayerEvent :string
WebRTCPlayer HISPlayer event types.
Properties:
Name | Value | Type | Description |
---|---|---|---|
LICENSE_ERROR |
licenseError | string | |
STATE_CHANGE |
stateChange | string | The event has the detail field with the PLAYER_STATES. |
BUFFER_TYPE |
bufferType | string | The event has the detail field with the BUFFER_TYPE. |
ERROR |
error | string | The event has the detail field with the error. |
Methods
addEventListener(type, listener)
Add an event listener to this object.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The event type to listen for. |
listener |
EventListener | function | The callback or listener object to invoke. |
destroy()
Destroys the WebRTC player instance and cleans up all associated resources.
getVolume() → {number}
Returns the current volume. Valid values are contained between 0.0 and 1.0.
init(userConfig)
Create WebRTC player.
Parameters:
Name | Type | Description |
---|---|---|
userConfig |
WebRTCConfig |
isMuted() → {boolean}
Returns true if the current playback is muted.
listenToAllEvents(listener)
Add an event listener to this object that is invoked for all events types the object fires.
Parameters:
Name | Type | Description |
---|---|---|
listener |
EventListener | function | The callback or listener object to invoke. |
pause()
Pause the playback. If the stream is already paused, this method does nothing.
play()
Resumes the playback if the stream is loaded and paused.
removeEventListener(type, listener)
Remove an event listener from this object.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The event type for which you wish to remove a listener. |
listener |
EventListener | function | The callback or listener object to remove. |
setMute(muted)
Mute the current playback.
Parameters:
Name | Type | Description |
---|---|---|
muted |
boolean |
setVolume(volume)
Set the volume for the current playback.
Parameters:
Name | Type | Description |
---|---|---|
volume |
number | The volume to set, from 0 (muted) to 1 (loudest). |