Installation and setup
Install MKPlayer, add it to an HTML page, and create an initialised player instance before loading media.
Prerequisites
-
npm available in your project
-
A player license key from MediaKind
-
Your deployment domain added to the MediaKind license allowlist
The player will not start if your domain is not allowlisted. You will see a
PLAYER_SETUP_MISSING_LICENSE_ALLOWLISTerror. Contact MediaKind to add your domain before going further.
Install and initialise
Install the package
- Terminal window
Include the scripts in your page
Add a video container element
Create a player instance
The player is now initialised and ready to load a source. See Loading and playing content for the next step.
Player configuration options
The MKPlayerConfig object controls how the player behaves. All properties are optional except where noted.
Additional requirements for Apple devices
Safari on Mac, iPhone, and iPad requires an extra step to support secure URLs and custom HTTP headers via setHttpHeaders.
Download serviceWorker.js from the MKPlayer SDK resources.
-
Place the file at the root of the domain where your web app is hosted, for example
https://yourdomain.com/serviceWorker.js. -
Explicitly enable
native_hls_parsingin your player configuration:
The SDK enables native_hls_parsing by default if the property is not set, but setting it explicitly ensures consistent behaviour across environments.