MKFMTSController is a MKPlayer plugin that adds Friend MTS ASiD watermarking support to provide avanced content security and anti-piracy features to MKPlayer SDK.
Please follow the instructions on this page to understand how to properly add this plugin to MKPlayer.
Please note that this plugin is supported to work only with MediaKind registered source streams. This plugin depends on MKPlayer as its dependency and needs MKPlayer version 1.6.0 or newer for proper functioning.
Install the plugin via NPM as below
npm install @medikind/mkplayer-fmts-plugin
Next include mkplayer-fmts-plugin.js in the head of your HTML page along side mkplayer.js as below:
<head>
<title>My Video Player</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- MKPlayer JavaScript and CSS along with MKFMTSController -->
<script type="text/javascript" src="./node_modules/@mediakind/mkplayer/mkplayer.js"></script>
<link rel="stylesheet" href="./node_modules/@mediakind/mkplayer/mkplayer-ui.css">
<script type="text/javascript" src="./node_modules/@mediakind/mkplayer-fmts-plugin/mkplayer-fmts-plugin.js"></script>
</head>
Next, in your application import the plugin as below.
import { MKFMTSController, MKFMTSError, MKFMTSConfig } from "@medikind/mkplayer-fmts-plugin";
Initialize the plugin and hook it up with MKPlayer as below:
// Initialize MKPlayer as before with video container and player config.
const player = new mkplayer.MKPlayer(videoContainer, playerConfig);
// FMTS config with mandatory properties.
// please refer to documentation on all other optional properties.
const fmtsConfig: MKFMTSConfig = {
appName: "<Specific your application name>",
appVersion: "<Specify your application version>"
};
// Listen for FMTS error notifications
function onFMTSError(error: MKFMTSError): void {
console.warn(`onFMTSError: code: ${error.code} and message: ${error.message}`);
}
// Initialize MKFMTSController with the create player handle, FMTS config and error callback.
const fmtsController = new mkplayerFMTSPlugin.MKFMTSController(player, fmtsConfig, onFMTSError);
// To update the FMTS config after initializing the controller and before source is loaded use
fmtsController.updateFMTSConfig({
appName: "<Specify your application name>",
appVersion: "<Specify your application version>",
assetTitle: "<Specify your asset title>"
});
Now at this stage you are all set and nothing more needs to be done to use the FMTS controller. You can load source for playback normally after this step and the controller will automatically listen to the many player events and function to display watermark on your assets. However, please note that the controller does not disturb the playback on any security issues and it will merely notify the application of any security issues via the callback and it is on the application to act on the security issues reported.