Loading and playing content
Pass a source configuration object to player.load() to load content into an initialised player. You can then control playback or destroy the player instance when it is no longer needed.
Prerequisites
You have an initialised MKPlayer instance. See Installation and setup.
Load a source
Build a MKSourceConfig object that describes your content, then call player.load():
Pass only one stream type in the source configuration: either hls or dash. When both are present, the player selects based on platform support.
For DRM-protected content, you also need to pass a drm property. See DRM protection.
Source configuration options
Control playback
After a source is loaded, use the player API to control playback:
Unload a source
To stop playback and clear the current source without destroying the player instance:
You can call player.load() again after unload() to play a different source.
Destroy the player
To tear down the player entirely and release all held resources:
You must create a new MKPlayer instance after calling destroy(). Calling a player API method after destroy() returns a PLAYER_API_NOT_AVAILABLE error.
It is recommended to wait for the Destroy event before discarding your player reference: