If you need WebRTC live streaming server, please contact us here.
To use WebRTC in Unity, you must change the WebGL Mode in the Platform WebGL settings:
When the WebRTC platform mode is enabled, the SDK is still managed by HISPlayerManager, but only a subset of the public API is supported.
Override this method to add custom logic when HISPlayerEvent.HISPLAYER_EVENT_PLAYBACK_READY is triggered. This event occurs when the current playback of a stream is ready to be used. Calling functions such as GetTracks before this event is triggered will provide null information.
| Name | Description |
|---|---|
| param1 | Number of tracks of the playback. |
Override this method to add custom logic when HISPlayerEvent.HISPLAYER_EVENT_PLAYBACK_BUFFERING is triggered. This event occurs whenever an internal playback is buffering.
Override this method to add custom logic when HISPlayerEvent.HISPLAYER_EVENT_PLAYBACK_PLAY is triggered. This event occurs whenever an internal playback has been played.
Override this method to add custom logic when HISPlayerEvent.HISPLAYER_EVENT_PLAYBACK_PAUSE is triggered. This event occurs whenever an internal playback has been paused.
Override this method to add custom logic when HISPlayerEvent.HISPlayer_EVENT_END_OF_CONTENT is triggered. This event occurs whenever an internal playback reaches the end of the video content.
These functions can’t be overridden and they can be used only inside the inherited script. If it’s needed to use some of these functions in the Unity scene, for example with buttons, it is needed to create a public function that connects the button with the API.
Play a certain stream giving a playerIndex. The playerIndex is associated with the index of the element of Multi Stream Properties, e.g. the index 0 is the element 0 in the list.
Pause a certain stream giving a playerIndex. The playerIndex is associated with the index of the element of Multi Stream Properties, e.g. the index 0 is the element 0 in the list.
Modify the volume of a certain stream giving a playerIndex. The volume of the track value ranges between 0.0f and 1.0f. The playerIndex is associated with the index of the element of Multi Stream Properties, e.g. the index 0 is the element 0 in the list. Call this API after having interaction with the web page/screen, otherwise audio will not play on WebGL due to browser autoplay policy.
