📖

Overview

Overview

KWIKplayer is a highly customizable video player built on the Video.js library, extending its basic functionality with a set of advanced features and custom modules. Designed to handle various playback formats, KWIKplayer enhances the user experience by offering additional capabilities such as IMA, IMA-DAI, Chromecast, AirPlay, DVR, DRM, VR, hotspots, and more.

Key Features

  • Custom Modules: Add and configure additional functionality like IMA (Interactive Media Ads), IMA-DAI (Dynamic Ad Insertion), and more.
  • Advanced Playback Features: Support for DRM (Digital Rights Management), VR (Virtual Reality), DVR (Digital Video Recorder) functionality, and interactive hotspots.
  • Chromecast & AirPlay Support: Seamlessly stream videos to compatible devices.
  • Multiple Playback Formats: Handle a wide range of video formats and adaptive streaming options.
  • Responsive Design: Ensures a great viewing experience across all devices, from desktops to smartphones.
⚙️

Setup

Setup

Using KWIKplayer with Vanilla JavaScript

Follow these steps to set up KWIKplayer in a plain JavaScript environment:

  1. Add the KWIKplayer Script to Your Project Include the KWIKplayer library by appending the following script tag to your HTML file or dynamically adding it via JavaScript.
 <script src="https://player.kwikmotion.com/ClientsTemplates/EXAMPLE/KwikLink_EXAMPLE_EXAMPLE_v9.js"></script>

*or use your specific license file link.

  1. Add Your Script to the Project Make sure to put that your script will be run after KWIKplayer extenral script
 <script src="./index.js"></script>
  1. Create a Video Player Element Add an HTML container for the player. The id will be used to initialize the player.
 <div id="kwik-player" class="kwik-player"></div>
  1. Initialize the Player Use the following script to initialize the player. Replace the options with your desired configuration:
 if (!window.initPlayer) {
 console.error('KWIKplayer script not loaded');
 }

 const options = {
 bigPlayButton: true,
 src: 'https://vjs.zencdn.net/v/oceans.mp4',
 };

 window.initPlayer('kwik-player', options);

To get the player instance, call initPlayer with a 3rd argument, which accepts a callback that will be executed when the player is ready:

 window.initPlayer('kwik-player', options, () => {
 const player = window.kwikMotion('kwik-player');
 });
  1. Add event listeners as needed:
 ({
 player.on('loadeddata', () => console.log('Video Loaded'));
 player.on('play', () => console.log('Playing'));
 player.on('pause', () => console.log('Paused'));
 });

Using KWIKplayer with TypeScript

  1. Add the KWIKplayer script and your enter script from dist.
  2. Download and add in your project KWIKplayer types from: https://playerv9.kwikmotion.com/types/KwikLink.d.ts
  3. Import KwikMotion into your script
 import {KwikMotion} from './types/KwikLink'
  1. Define options and initialize the player like in js example using TypeScript types:
 const options: KwikMotion.Options = {
 bigPlayButton: true,
 controlBar: {
 skipButtons: {
 forward: 30,
 backward: 30,
 },
 },
 titleBar: {
 title: 'Kwik',
 description: 'Kwik',
 },
 src: 'https://vjs.zencdn.net/v/oceans.mp4',
 };

 if (window.initPlayer) {
 const player: KwikMotion.Player | undefined = window.initPlayer('kwik-player', options);
 player?.one('loadeddata' as KwikMotion.Event, (event) => console.log(event));

 player?.on(['pause', 'play'] as KwikMotion.Event[], () => console.log('Video Loaded'));
 }
🎬

Embed

Embed Player

You can embed the player into your application or website using an iframe. The embed URL structure is as follows:

https://embed.kwikmotion.com/Embed/{VideoID}

Example

To embed a video, replace {VideoID} in the URL with the actual video ID.

Code Example

<iframe
 src="https://embed.kwikmotion.com/Embed/{VideoID}"
 width="640"
 height="360"
 allowfullscreen>
</iframe>

Ensure that the video ID used in the URL is valid and accessible thought the KWIKmotion.

📋

Options

Standard <video> Element Options

autoplay

Type: boolean|string NOTE: At this point, the autoplay attribute and option are NOT a guarantee that your video will autoplay. NOTE2: If there is an attribute on the media element the option will be ignored. NOTE3: You cannot pass a string value in the attribute, you must pass it in the videojs options

Instead of using the autoplay attribute you should pass an autoplay option to the videojs function. The following values are valid:

  • a boolean value of false: the same as having no attribute on the video element, won't autoplay
  • a boolean value of true: the same as having attribute on the video element, will use browsers autoplay
  • a string value of 'muted': will mute the video element and then manually call play() on loadstart. This is likely to work.
  • a string value of 'play': will call play() on loadstart, similar to browsers autoplay
  • a string value of 'any': will call play() on loadstart and if the promise is rejected it will mute the video element then call play().

To pass the option

window.initPlayer('my-video', {
 autoplay: 'muted'
});

// or

player.autoplay('muted');

More info on autoplay support and changes:

controlBar.remainingTimeDisplay.displayNegative

Type: boolean

Bu default the remaining time display shows as negative time. To not show the negative sign set controlBar.remainingTimeDisplay.displayNegative to false.

controls

Type: boolean

Determines whether or not the player has controls that the user can interact with. Without controls the only way to start the video playing is with the autoplay attribute or through the Player API.

height

Type: string|number

Sets the display height of the video player in pixels.

loop

Type: boolean

Causes the video to start over as soon as it ends.

muted

Type: boolean

Will silence any audio by default.

poster

Type: string

A URL to an image that displays before the video begins playing. This is often a frame of the video or a custom title screen. As soon as the user hits "play" the image will go away.

preload

Type: string

Suggests to the browser whether or not the video data should begin downloading as soon as the <video> element is loaded. Supported values are:

'auto'

Start loading the video immediately (if the browser supports it). Some mobile devices will not preload the video in order to protect their users' bandwidth/data usage. This is why the value is called 'auto' and not something more conclusive like 'true'.

This tends to be the most common and recommended value as it allows the browser to choose the best behavior.

'metadata'

Load only the meta data of the video, which includes information like the duration and dimensions of the video. Sometimes, the meta data will be loaded by downloading a few frames of video.

'none'

Don't preload any data. The browser will wait until the user hits "play" to begin downloading.

src

Type: string

The source URL to a video source to embed.

width

Type: string|number

Sets the display width of the video player in pixels.

Video.js-specific Options

aspectRatio

Type: string

Puts the player in fluid mode and the value is used when calculating the dynamic size of the player. The value should represent a ratio - two numbers separated by a colon (e.g. "16:9" or "4:3").

Alternatively, the classes vjs-16-9, vjs-9-16, vjs-4-3 or vjs-1-1 can be added to the player.

audioOnlyMode

Type: boolean Default: false

If set to true, it asynchronously hides all player components except the control bar, as well as any specific controls that are needed only for video. This option can be set to true or false by calling audioOnlyMode([true|false]) at runtime. When used as a setter, it returns a Promise. When used as a getter, it returns a Boolean.

audioPosterMode

Type: boolean Default: false

If set to true, it enables the poster viewer experience by hiding the video element and displaying the poster image persistently. This option can be set to true or false by calling audioPosterMode([true|false]) at runtime.

autoSetup

Type: boolean

Prevents the player from running the autoSetup for media elements with data-setup attribute.

Note: this must be set globally with videojs.options.autoSetup = false in the same tick as videojs source is loaded to take effect.

breakpoints

Type: Object

When used with the responsive option, sets breakpoints that will configure how class names are toggled on the player to adjust the UI based on the player's dimensions.

By default, the breakpoints are:

Class NameWidth Range
vjs-layout-tiny0-210
vjs-layout-x-small211-320
vjs-layout-small321-425
vjs-layout-medium426-768
vjs-layout-large769-1440
vjs-layout-x-large1441-2560
vjs-layout-huge2561+

While the class names cannot be changed, the width ranges can be configured via an object like this:

breakpoints: {
 tiny: 300,
 xsmall: 400,
 small: 500,
 medium: 600,
 large: 700,
 xlarge: 800,
 huge: 900
}
  • The keys of the breakpoints object are derived from the associated class names by removing the vjs-layout- prefix and any - characters.
  • The values of the breakpoints object define the max width for a range.
  • Not all keys need to be defined. You can easily override a single breakpoint by passing an object with one key/value pair! Customized breakpoints will be merged with default breakpoints when the player is created.

When the player's size changes, the merged breakpoints will be inspected in the size order until a matching breakpoint is found.

That breakpoint's associated class name will be added as a class to the player. The previous breakpoint's class will be removed.

See the file sandbox/responsive.html.example for an example of a responsive player using the default breakpoints.

children

Type: Array|Object

This option is inherited from the Component base class.

disablePictureInPicture

Type: boolean

If true, switching the video element into picture-in-picture is disabled. Default is false.

This has no effect on Firefox's proprietary picture-in-picture mode which does not implement the standard picture-in-picture API.

This does not disable the document picture-in-picture mode which allows the player element to put into a PiP window.

enableDocumentPictureInPicture

Type: boolean

If true, the documentPictureInPicture API will be used for picture-in-picture, if available. Defaults to false, but may default to true when the feature has become established.

Supported by Chrome and Edge from version 116.

This is a different picture-in-picture mode than has previously been available, where the entire player element is windowed rather than just the video itself. Since there are scenarios where it would be desirable to allow PiP on the player but not PiP on the video alone (such as ads, overlays), the disablePictureInPicture option only disables the old-style picture-in-picture mode on the video.

enableSmoothSeeking

Type: boolean Default: false

If set to true, will provide a smoother seeking experience on mobile and desktop devices.

The following will enable the smooth seeking:

window.initPlayer('my-player', {
 enableSmoothSeeking: true
});

Can also be modified after player creation:

window.initPlayer('my-player');

player.options({ enableSmoothSeeking: true });

experimentalSvgIcons

Type: boolean

If set to true, the icons used throughout the player from videojs/font will be replaced by SVGs stored in Video.js. Defaults to false, but may default to true when the feature has become established.

These SVGs were downloaded from Font Awesome and Google's Material UI.

You can view all of the icons available by renaming sandbox/svg-icons.html.example to sandbox/svg-icons.html, building Video.js with npm run build, and opening sandbox/svg-icons.html in your browser of choice.

Icons are expected to be added to a Component inside of the player using the setIcon method when customizing the player.

fluid

Type: boolean

When true, the Video.js player will have a fluid size. In other words, it will scale to fit its container at the video's intrinsic aspect ratio, or at a specified aspectRatio.

Also, if the <video> element has the "vjs-fluid", this option is automatically set to true.

fullscreen

Type: Object Default: {options: {navigationUI: 'hide'}

fullscreen.options can be set to pass in specific fullscreen options. At some point, it will be augmented with element and handler for more functionality.

options

Type: Object Default: {navigationUI: 'hide'}

See The Fullscreen API Spec for more details.

id

Type: string

If provided, and the element does not already have an id, this value is used as the id of the player element.

inactivityTimeout

Type: number

Video.js indicates that the user is interacting with the player by way of the "vjs-user-active" and "vjs-user-inactive" classes and the "useractive" event.

The inactivityTimeout determines how many milliseconds of inactivity is required before declaring the user inactive. A value of 0 indicates that there is no inactivityTimeout and the user will never be considered inactive.

language

Type: string, Default: browser default or 'en'

A language code matching one of the available languages in the player. This sets the initial language for a player, but it can always be changed.

Learn more about languages in Video.js.

languages

Type: Object

Customize which languages are available in a player. The keys of this object will be language codes and the values will be objects with English keys and translated values.

Learn more about languages in Video.js

Note: Generally, this option is not needed and it would be better to pass your custom languages to videojs.addLanguage(), so they are available in all players!

liveui

Type: boolean Default: false

Allows the player to use the new live ui that includes:

  • A progress bar for seeking within the live window
  • A button that can be clicked to seek to the live edge with a circle indicating if you are at the live edge or not.

Without this option the progress bar will be hidden and in its place will be text that indicates LIVE playback. There will be no progress control and you will not be able click the text to seek to the live edge. liveui will default to true in a future version!

liveTracker.trackingThreshold

Type: number Default: 20

An option for the liveTracker component of the player that controls when the liveui should be shown. By default if a stream has less than 20s on the seekBar then we do not show the new liveui even with the liveui option set.

liveTracker.liveTolerance

Type: number Default: 15

An option for the liveTracker component of the player that controls how far from the seekable end should be considered live playback. By default anything further than 15s from the live seekable edge is considered behind live and everything else is considered live. Any user interaction to seek backwards will ignore this value as a user would expect.

nativeControlsForTouch

Type: boolean

Explicitly set a default value for the associated tech option.

normalizeAutoplay

Type: boolean

Specify whether setting autoplay: true and <video autoplay> should be treated the same as autoplay: 'play', i.e. the autoplay attribute should be removed from (or not added to) the video element and play() be initiated manually by Video.js rather than the browser.

notSupportedMessage

Type: string

Allows overriding the default message that is displayed when Video.js cannot play back a media source.

noUITitleAttributes

Type: boolean Default: false

Control whether UI elements have a title attribute. A title attribute is shown on mouse hover, which can be helpful for usability, but has drawbacks for accessibility. Setting noUITitleAttributes to true prevents the title attribute from being added to UI elements, allowing for more accessible tooltips to be added to controls by a plugin or external framework.

playbackRates

Type: Array

An array of numbers strictly greater than 0, where 1 means regular speed (100%), 0.5 means half-speed (50%), 2 means double-speed (200%), etc. If specified, Video.js displays a control (of class vjs-playback-rate) allowing the user to choose playback speed from among the array of choices. The choices are presented in the specified order from bottom to top.

For example:

window.initPlayer('my-player', {
 playbackRates: [0.5, 1, 1.5, 2]
});

playsinline

Type: boolean

Indicates to the browser that non-fullscreen playback is preferred when fullscreen playback is the native default, such as in iOS Safari.

For example:

window.initPlayer('my-player', {
 playsinline: true
});

plugins

Type: Object

This supports having plugins be initialized automatically with custom options when the player is initialized - rather than requiring you to initialize them manually.

window.initPlayer('my-player', {
 plugins: {
 foo: {bar: true},
 boo: {baz: false}
 }
});

The above is roughly equivalent to:

window.initPlayer('my-player');

player.foo({bar: true});
player.boo({baz: false});

Although, since the plugins option is an object, the order of initialization is not guaranteed!

See the plugins guide for more information on Video.js plugins.

preferFullWindow

Type: boolean, Defaut: false

Setting this to true will change fullscreen behaviour on devices which do not support the HTML5 fullscreen API but do support fullscreen on the video element, i.e. iPhone. Instead of making the video fullscreen, the player will be stretched to fill the browser window.

responsive

Type: boolean, Default: false

Setting this option to true will cause the player to customize itself based on responsive breakpoints (see: breakpoints option).

When this option is false (the default), responsive breakpoints will be ignored.

Note this is about the responsiveness of the controls within the player, not responsive sizing of the player itself. For that, see fluid.

restoreEl

Type boolean or Element, Default: false

If set to true, a copy of the placeholder element will be made before the player is initalised. If the player is disposed, the copy is put back into the DOM in the player's place.

If set to an HTML Element, that element would replace the disposed player instead.

skipButtons

Type: Object

skipButtons.forward

Type: number

If specified, Video.js displays a control allowing the user to jump forward in a video by the specified number of seconds.

The following values are valid: 5 | 10 | 30

window.initPlayer('my-player', {
 controlBar: {
 skipButtons: {
 forward: 5
 }
 }
});

skipButtons.backward

Type: number

If specified, Video.js displays a control allowing the user to jump back in a video by the specified number of seconds.

The following values are valid: 5 | 10 | 30

window.initPlayer('my-player', {
 controlBar: {
 skipButtons: {
 backward: 10
 }
 }
});

sources

Type: Array

An array of objects that mirror the native <video> element's capability to have a series of child <source> elements. This should be an array of objects with the src and type properties. For example:

window.initPlayer('my-player', {
 sources: [{
 src: '//path/to/video.mp4',
 type: 'video/mp4'
 }, {
 src: '//path/to/video.webm',
 type: 'video/webm'
 }]
});

Using <source> elements will have the same effect:

<video ...>
 <source src="//path/to/video.mp4" type="video/mp4">
 <source src="//path/to/video.webm" type="video/webm">
</video>

suppressNotSupportedError

Type: boolean

If set to true, then the no compatible source error will not be triggered immediately and instead will occur on the first user interaction. This is useful for Google's "mobile friendly" test tool, which can't play video but where you might not want to see an error displayed.

techCanOverridePoster

Type: boolean

Gives the possibility to techs to override the player's poster and integrate into the player's poster life-cycle. This can be useful when multiple techs are used and each has to set their own poster any time a new source is played.

techOrder

Type: Array, Default: ['html5']

Defines the order in which Video.js techs are preferred. By default, this means that the Html5 tech is preferred. Other registered techs will be added after this tech in the order in which they are registered.

userActions

Type: Object

userActions.click

Type: boolean|function

Controls how clicking on the player/tech operates. If set to false, clicking is disabled and will no longer cause the player to toggle between paused and playing. If controls are disabled with controls: false, this will not call the handler function.

window.initPlayer('my-player', {
 userActions: {
 click: false
 }
});

If undefined or set to true, clicking is enabled and toggles the player between paused and play. To override the default click handling, set userActions.click to a function which accepts a click event (in this example it will request Full Screen, the same as a userActions.doubleClick):

function myClickHandler(event) = {
 // `this` is the player in this context

 if (this.isFullscreen()) {
 this.exitFullscreen();
 } else {
 this.requestFullscreen();
 }
};

window.initPlayer('my-player', {
 userActions: {
 click: myClickHandler
 }
});

userActions.doubleClick

Type: boolean|function

Controls how double-clicking on the player/tech operates. If set to false, double-clicking is disabled. If undefined or set to true, double-clicking is enabled and toggles fullscreen mode. To override the default double-click handling, set userActions.doubleClick to a function which accepts a dblclick event:

function myDoubleClickHandler(event) = {
 // `this` is the player in this context

 this.pause();
};

window.initPlayer('my-player', {
 userActions: {
 doubleClick: myDoubleClickHandler
 }
});

userActions.hotkeys

Type: boolean|function|object

Controls how player-wide hotkeys operate. If set to false, or undefined, hotkeys are disabled. If set to true or an object (to allow definitions of fullscreenKey etc. below), hotkeys are enabled as described below. To override the default hotkey handling, set userActions.hotkeys to a function which accepts a keydown event. If controls are disabled with controls: false, this will not call the handler function.

window.initPlayer('my-player', {
 userActions: {
 hotkeys: function(event) {
 // `this` is the player in this context

 // `x` key = pause
 if (event.which === 88) {
 this.pause();
 }
 // `y` key = play
 if (event.which === 89) {
 this.play();
 }
 }
 }
});

Default hotkey handling is:

KeyActionEnabled by
ftoggle fullscreenonly enabled if a Fullscreen button is present in the Control Bar
mtoggle mutealways enabled, even if no Control Bar is present
ktoggle play/pausealways enabled, even if no Control Bar is present
Spacetoggle play/pausealways enabled, even if no Control Bar is present

Hotkeys require player focus first. Note that the Space key activates controls such as buttons and menus if that control has keyboard focus. The other hotkeys work regardless of which control in the player has focus.

userActions.hotkeys.fullscreenKey

Type: function

Override the fullscreen key definition. If this is set, the function receives the keydown event; if the function returns true, then the fullscreen toggle action is performed.

window.initPlayer('my-player', {
 userActions: {
 hotkeys: {
 muteKey: function(event) {
 // disable mute key
 },
 fullscreenKey: function(event) {
 // override fullscreen to trigger when pressing the v key
 return (event.which === 86);
 }
 }
 }
});

userActions.hotkeys.muteKey

Type: function

Override the mute key definition. If this is set, the function receives the keydown event; if the function returns true, then the mute toggle action is performed.

userActions.hotkeys.playPauseKey

Type: function

Override the play/pause key definition. If this is set, the function receives the keydown event; if the function returns true, then the play/pause toggle action is performed.

vtt.js

Type: string

Allows overriding the default URL to vtt.js, which may be loaded asynchronously to polyfill support for WebVTT.

This option will be used in the "novtt" build of Video.js (i.e. video.novtt.js). Otherwise, vtt.js is bundled with Video.js.

Spatial Navigation

spatialNavigation

Type: Object Default: {enabled: false, horizontalSeek: false}

This option configures the Spatial Navigation within the Video.js player, enhancing accessibility and user experience on devices like smart TVs, where navigation through remote control is common.

Properties

  • enabled Type: boolean Default: false If set to true, enables the Spatial Navigation system in the player, allowing users to navigate through focusable components using the arrow keys on their remote control.

  • horizontalSeek Type: boolean Default: false When enabled, this allows users to use the left and right arrow keys for seeking through the video timeline, enhancing the navigation experience.

Usage

To enable Spatial Navigation with the default settings:

window.initPlayer('my-player', {
 spatialNavigation: {
 enabled: true
 }
});

To enable Spatial Navigation with horizontal seeking:

window.initPlayer('my-player', {
 spatialNavigation: {
 enabled: true,
 horizontalSeek: true
 }
});

Component Options

children

Type: Array|Object

If an Array - which is the default - this is used to determine which children (by component name) and in which order they are created on a player (or other component):

// The following code creates a player with ONLY bigPlayButton and
// controlBar child components.
window.initPlayer('my-player', {
 children: [
 'bigPlayButton',
 'controlBar'
 ]
});

The children options can also be passed as an Object. In this case, it is used to provide options for any/all children, including disabling them with false:

// This player's ONLY child will be the controlBar. Clearly, this is not the
// ideal method for disabling a grandchild!
window.initPlayer('my-player', {
 children: {
 controlBar: {
 fullscreenToggle: false
 }
 }
});

${componentName}

Type: Object

Components can be given custom options via the lower-camel-case variant of the component name (e.g. controlBar for ControlBar). These can be nested in a representation of grandchild relationships. For example, to disable the fullscreen control:

window.initPlayer('my-player', {
 controlBar: {
 fullscreenToggle: false
 }
});

Tech Options

${techName}

Type: Object

Video.js playback technologies (i.e. "techs") can be given custom options as part of the options passed to the videojs function. They should be passed under the lower-case variant of the tech name (e.g. "html5").

html5

nativeControlsForTouch

Type: boolean

Only supported by the Html5 tech, this option can be set to true to force native controls for touch devices.

nativeAudioTracks

Type: boolean

Can be set to false to disable native audio track support. Most commonly used with videojs-contrib-hls.

nativeTextTracks

Type: boolean

Can be set to false to force emulation of text tracks instead of native support. The nativeCaptions option also exists, but is simply an alias to nativeTextTracks.

nativeVideoTracks

Type: boolean

Can be set to false to disable native video track support. Most commonly used with videojs-contrib-hls.

preloadTextTracks

Type: boolean

Can be set to false to delay loading of non-active text tracks until use. This can cause a short delay when switching captions during which there may be missing captions.

The default behavior is to preload all text tracks.

KWIKplayer Options

showBigPlayButtonOnPause

Type: boolean

Shows the big play button when the video is paused.

titleBar

Type: { title?: string; description?: string }

Adds a title bar with an optional title and description.

persistTextTrackSettings

Type: boolean

Saves user text track settings (e.g., captions) between sessions.

cache

Type: KwikPlayer.Options

Enables caching of specific options for faster reinitialization.

clientKey

Type: string

Unique identifier for authenticating or tracking a specific client instance.

customCss

Type: string[]

An array of custom CSS file URLs to apply to the player.

customModules

Type: KwikPlayer.Options.Module[]

A list of custom modules to load into the player.

Key Type Description
name Modules | string The name of the module.
order number | undefined The order in which the module should be loaded.
js Module.File[] Array of JavaScript files for the module.
css Module.File[] | undefined Array of CSS files for the module.
enabled (player: Player) => boolean Function to check if the module is enabled.
init (player: Player) => void | undefined Optional function to initialize the module.

debug

Type: boolean | { events: boolean }

Enables debugging features or event-specific logging.

eventListeners

Type: KwikPlayer.Options.EventListeners

Registers custom event listeners on the player.

Key Type Description
any Record<CommaSeparated<Player.Event>, ((event: unknown) => void)[]> List of functions triggered for each event type.
on Record<CommaSeparated<Player.Event>, ((event: unknown) => void)[]> Event listeners that are triggered when the event occurs.
one Record<CommaSeparated<Player.Event>, ((event: unknown) => void)[]> Event listeners that are triggered only once when the event occurs.

tag

Type: 'video' | 'audio'

Specifies the type of media element used by the player.

theme

Type: 'default' | 'kwikplayer' | 'city' | 'fantasy' | 'forest' | 'sea' | string

Sets a theme for the player, including predefined and custom options.

themeConfig

Type: { adjustOptions?: (options: Options) => Options; adjustBehavior?: (player: Player) => void; adjustIcons?: (player: Player) => void }

Configures theme-specific behaviors, options, and icons.

🧩

Components

KWIKmotion Player V9 includes the following custom components:

Big Pause Buttons

BigPauseButtons

This component dynamically adds specific control buttons when it detects a mobile device. The controls buttons include a large pause button and large skip forward/backward buttons.

  • The component checks if the user is on a mobile device.
  • The skip buttons are hidden when the video is paused or during live streaming.
  • The large pause button is displayed when the video is playing.

Initialization

This button is enabled by default for the KWIKplayer theme and is only available in the KWIKplayer theme. If you want to add this button to another theme, you need to configure it in the options.

To do so, ensure that components responsible for big buttons are included in the player. You can specify this by setting children: ['bigPlayButton', 'bigPauseButtons'].

Note: This configuration will override the default list of children, so be sure to include all required components.

Additionally, custom CSS styles are necessary to ensure the button displays correctly in your chosen theme.

Context Menu

ContextMenu

The ContextMenu component is a custom video.js menu that replaces the default browser context menu when a user right-clicks on the video player. It displays a custom context menu with links and version information about KWIKmotion and KWIKplayer.

Initialization

The component is already set by default to show current KWIKplayer version

Custom Button

Custom Button

The CustomButton component is a highly customizable button for your player. It can be used in two ways:

  • As a simple button that triggers a custom event.
  • As a button with a menu, where each menu item can trigger its own event.

Configuration Options for

OptionTypeDescription
enabledbooleanWhether the button is enabled or not. Defaults to true.
classNamestring or array of stringsCustom CSS class(es) for the button. You can pass multiple class names as an array.
controlTextstringText that will appear on the button. Used for accessibility.
eventNamestringThe event that will be triggered when the button is clicked.
menuItemsmenuItem[]Array of menu item objects for the button to display a dropdown.
stylestringInline styles for the button element.
iconNamestringIcon name for the button (e.g., 'play', 'pause', etc.). This can be used to set an icon on the button.

Configuration Options for

OptionTypeRequiredDescription
labelstringYesThe label to display for the menu item.
eventNamestringNoThe event triggered when the menu item is clicked. If not provided, the menu item won't trigger any event.

Example Configurations

Option 1: Simple Button

const player = window.kwikMotion('my-video', {
 ccbutton: {
 enabled: true,
 className: 'some-class test-class',
 controlText: 'Click Me',
 eventName: 'cclick',
 },
})

Option 2: Button with Menu

const player = window.kwikMotion('my-video', {
 ccbutton: {
 className: 'cass',
 controlText: 'click Me',
 eventName: 'click',
 menuItems: [
 {
 label: 'Option 1',
 eventName: 'menuOption1Click',
 },
 {
 label: 'Option 2',
 eventName: 'menuOption2Click',
 },
 ],
 },
})

Resume Modal

ResumeModal

The ResumeModal component allows users to resume video playback from where they left off. It stores the current playback position using either localStorage or cookies, depending on their availability, and presents a modal with two options: "Resume watching" and "Watch from beginning." The modal automatically appears when metadata is loaded and a stored resume time is available, unless the user is manually seeking. If localStorage is unavailable, the component falls back to using cookies to store the resume position.

Initialization

const player = window.kwikMotion('my-video', {
 resumeModal: true
})

Share Button

Share

The share button allows users to easily share the video by copying a link, sending it directly, or sharing via social media buttons. It also allows users to copy an embed link in an iframe format to insert on other websites.

The share button opens a modal window with pre-set options. This allows users to easily copy the link, send it, or create a post via social media buttons. It also allows users to copy the embed link to the video and insert it on any other website pasting <iframe> into the HTML.

Share modal window

The share modal window with buttons and inputs is opened by triggering sharing:open, and closed by triggering modalclose or beforemodalclose events. On opening the the share modal will trigger sharing:opened and on closing the modal window will trigger sharing:close or sharing:closed events.

Options

Options that Share component may receive:

{
 addButtonToControlBar?: boolean;
 buttonPositionIndex?: number;
 description?: string;
 embedCode?: string;
 fbAppId?: string;
 image?: string;
 mobileVerification?: boolean;
 redirectUri?: string;
 showEmbedCode?: boolean;
 socials?: ('viber'
 | 'reddit'
 | 'facebook'
 | 'messenger'
 | 'linkedin'
 | 'telegram'
 | 'twitter'
 | 'whatsapp'
 | 'email'
 | 'pinterest')[];
 title?: string;
 url?: string;
}

Option Descriptions

  • url: The URL to be shared across social media platforms. By default, this is set to the current page URL.
  • showEmbedCode: Enables the display of an input field with the embed code for the video.
  • embedCode: Allows setting a custom iframe HTML snippet for embedding. If not provided, a default iframe code is generated based on the url:
    <iframe src='${url}' width='560' height='315' allowfullscreen></iframe>
    
  • fbAppId (optional): The Facebook App ID, used only when integrating with Facebook’s SDK-based sharing (fbFeed from vanilla-sharing). This enables richer feed post customization, such as automatic metadata extraction and advanced analytics.

⚠️ Not required for basic Facebook sharing. If fbAppId is not provided, the component will fall back to using Facebook’s sharer dialog, which opens a popup allowing users to share the URL without needing any Facebook App.

  • redirectUri: The URI Facebook will redirect to after sharing, defaulting to ${url}#close_window.
  • mobileVerification: When set to true, filters out certain social platforms (whatsapp, viber, messenger) on non-mobile devices, ensuring these mobile-specific apps are only shown on mobile.
  • socials: An array of enabled social platforms. Supported values include email, linkedin, messenger, reddit, telegram, twitter, viber, whatsapp, and facebook. This option allows for fine-grained control over which platforms are shown.
  • image: A URL pointing to the image displayed in social media link previews.
  • title: A string title used in social media link previews.
  • description: A description of the content being shared, used for social media link previews.

Example usage

const player = window.kwikMotion('my-video', {
 shareOptions: {
 description: 'It is an implementation of the share button plugin on video.js framework',
 fbAppId: '123123123123',
 image: 'https://dummyimage.com/1200x630',
 mobileVerification: true,
 redirectUri: 'https://www.whitepeaks.co.uk/en/#close',
 showEmbedCode: true,
 socials: [
 'email',
 'linkedin',
 'messenger',
 'reddit',
 'telegram',
 'twitter',
 'viber',
 'whatsapp',
 'facebook'
 ],
 title: 'videojs-share component',
 url: 'https://www.whitepeaks.co.uk/en/'
 }
})

Soap Button

SoapButton

The SoapButton is a custom button in the Video.js player that opens a specialized SoapMenu for browsing series and episodes. The SoapMenu presenting them in a videojs menu. Users can navigate through the episodes, and the menu dynamically adjusts based on available content.

Initialization

To enable SoapButton need to add in following options:

controlBar: {
 soapButton: {
 xml: 'xml link' // Replace with the actual XML file URL
 }
}

XML Structure

<playlist>
 <title>Test Series</title>
 <seasons>
 <season>
 <title>Test Season 1</title>
 <episode>
 <title>Test Episode 1</title>
 <image>https://example.com/test-image.jpg</image>
 <description>Test Episode Description</description>
 <url>https://example.com/test-episode.mp4</url>
 <duration>10:00</duration>
 </episode>
 </season>
 </seasons>
</playlist>
  • <playlist>: Root element for the content.
  • <title>: Name of the series (used for the menu header).
  • <seasons>: Wrapper for all seasons.
  • <season>: Represents a single season and contains its episodes.
    • <title>: Name of the season.
      • <episode>: Contains details for each episode.
      • <title>: Name of the episode.
      • <image>: Thumbnail image for the episode.
      • <description>: Short description of the episode.
      • <url>: Link to the episode's video file.
      • <duration>: Duration of the episode in hh:mm:ss or mm:ss format.

Customization

You can style the SoapButton and SoapMenu using the following CSS classes:

Class NameDescription
vjs-soap-buttonApplied to the actual button element itself.
vjs-soap-menu-buttonApplied to the wrapper/container of the button.
vjs-soap-menuThe main menu container.
vjs-menu-titleTitle of the series or season in the menu.
vjs-episode-containerWrapper for each episode's details.
vjs-episode-itemIndividual episode entry.
vjs-episode-detailsContainer for episode's thumbnail and description.
vjs-episode-durationDisplays the duration of the episode.

Thumbnails

Thumbnails

The Thumbnails component is a custom video.js enhancement that provides visual previews of video content as users interact with the progress bar. When a user hovers over different points in the video timeline, this component displays relevant thumbnail images that correspond to those timestamps. This functionality enables users to quickly navigate to specific scenes within the video, enhancing the overall user experience.

Metadata Requirements:

The video must include a metadata track with cues formatted according to the standard VTT specifications. Each cue should contain thumbnail information using the #xywh syntax.

Initialization

The component is already enabled by default, if source has tracks fields. Example of income source:

{
 sources: [
 {
 src: 'https://some.example.net/playlist.m3u8'
 }
 ],
 tracks: [
 {
 src: 'https://some.example.com/thumbs.vtt',
 kind: 'metadata'
 }
 ]
}

Video Quality Button

Video Quality Button

The button selector provides users with the ability to change the video quality dynamically based on available tracks.

Initialization

This button is enabled by default.

Dynamic Quality Selection

Displays a list of available video quality options based on the videoTracks() provided by the player.

Volume Manager

VolumeManager

This component is responsible for persisting the volume and mute state of the video player. It utilizes localStorage to store user preferences. If localStorage is not available (e.g., due to privacy settings or browser limitations), the component will store the volume and mute state in cookies. If neither localStorage nor cookies are available, the component will dispose itself.

Initialization

The component is already set by default.

🔌

Modules

KWIKmotion Player V9 supports the following modules:

Airplay

Airplay module

The Airplay module is designed to provide integration with Airplay devices enabling users to cast media content directly from their application to a Airplay receiver. It simplifies the process of establishing and managing casting sessions, offering developers a customizable and scalable solution for Airplay functionality.

Limitations

The module is incompatible with the Podcast module, Panorama module, or the Hotspots Editor module. Any of these configurations will prevent the module from functioning as intended. The module will be enabled only when the site uses the HTTPS protocol.

Options

OptionTypeDescription
addButtonToControlBarbooleanIndicates whether a Cast button should be added to the control bar.
buttonPositionIndexnumberSpecifies the position index where the Cast button should be placed within the control bar. Ignored if addButtonToControlBar is false.

Example

window.initPlayer('my-video', {
 airplayPlugin: {
 addButtonToControlBar: true,
 buttonPositionIndex: 16
 },
})

Chromecast

Chromecast module

The Chromecast module allows seamless casting of media directly to Chromecast devices, simplifying the process of establishing and managing casting sessions.

Features

  • Automatic Session Management
    • Automatically closes inactive sessions after a timeout (e.g., when the video is paused or ends, and the user does not interact).
    • Automatically disposes of sessions when the player is destroyed (except during a page refresh).
  • Customizable UI Integration
    • Provides a Cast button that can be added to the control bar.
    • Allows positioning of the Cast button within the control bar.

Limitations

The module is incompatible with the Podcast module, Panorama module, or the Hotspots Editor module. Any of these configurations will prevent the module from functioning as intended. Additionally, the module requires an HTTPS protocol to operate correctly. The module will be enabled only when the site uses the HTTPS protocol.

Options

OptionTypeDescription
receiverAppIDstringThe receiver application ID for the Chromecast. If not specified, the default app ID will be used.
addButtonToControlBarbooleanIndicates whether a Cast button should be added to the control bar.
buttonPositionIndexnumberSpecifies the position index where the Cast button should be placed within the control bar. Example: buttonPositionIndex: 16

Note: This property is ignored if addButtonToControlBar is set to false.

Example

window.initPlayer('my-video', {
 chromecastPlugin: {
 receiverAppID: '12345ABC',
 addButtonToControlBar: true,
 buttonPositionIndex: 16,
 },
})

Cue Points

Cue Points

The Cue Points module enables the addition of interactive cue points to a video player, allowing you mark important timestamps in the video.

How to Use

You can configure cue points programmatically by passing an object with the required options to the cuePointsPlugin.

Features

  • Multiple Cue Point Types: Support for code execution and chapters
  • Visual Progress Bar Markers: Display cue points as visual markers on the progress bar
  • Customizable Appearance: Configure marker colors, sizes, and tooltips

Example usage

window.initPlayer('my-video', {
 cuePointsPlugin: {
 enabled: true,
 maxTriggerDistance: 0.5,
 markerHeight: 6,
 markerWidth: 6,
 markerOpacity: 1,
 initialCuePoints: [
 {
 id: 'chapter-1',
 time: 10,
 type: 'chapter',
 marker: {
 markerColor: '#4CAF50',
 markerTitle: 'Introduction',
 tooltipBackgroundColor: 'rgba(76, 175, 80, 0.9)',
 tooltipTextColor: 'white'
 }
 },
 {
 id: 'code-execution',
 time: 30,
 type: 'code',
 action: 'console.log("Code executed at 30 seconds"); player.pause(); setTimeout(() => player.play(), 2000);',
 marker: {
 markerColor: '#2196F3',
 markerTitle: 'Code Execution',
 tooltipBackgroundColor: 'rgba(33, 150, 243, 0.9)',
 tooltipTextColor: 'white'
 }
 }
 ]
 }
})

Configuration

Global Options

  • enabled (boolean): Whether the cue points module is enabled (default: true)
  • maxTriggerDistance (number): Maximum distance in seconds to trigger a cue point (default: 0.5)
  • initialCuePoints (CuePointOptions): Array of initial cue points to add
  • markerHeight (number): Height of progress bar markers in pixels (default: 6)
  • markerWidth (number): Width of progress bar markers in pixels (default: 6)
  • markerOpacity (number): Opacity of progress bar markers (default: 1)

Cue Point Configuration

Each cue point requires the following properties:

  • id (string): Unique identifier for the cue point
  • time (number): Time in seconds when the cue point should trigger
  • type (CuePointType): Type of the cue point ('code' | 'chapter')
  • enabled (boolean): Whether the cue point is enabled (default: true)
  • action (string | function): Code to execute for 'code' type cue points
  • marker (CuePointMarkerOptions): Visual marker options (optional)

Cue Point Types

Code Cue Points

Execute custom JavaScript code when triggered.

{
 id: 'code-example',
 time: 30,
 type: 'code',
 action: 'console.log("Code executed at 30 seconds"); player.pause(); setTimeout(() => player.play(), 2000);',
 marker: {
 markerColor: '#2196F3',
 markerTitle: 'Code Execution',
 tooltipBackgroundColor: 'rgba(33, 150, 243, 0.9)',
 tooltipTextColor: 'white'
 }
}

Chapter Cue Points

Mark chapters or sections in the video.

{
 id: 'chapter-1',
 time: 10,
 type: 'chapter',
 marker: {
 markerColor: '#4CAF50',
 markerTitle: 'Introduction',
 tooltipBackgroundColor: 'rgba(76, 175, 80, 0.9)',
 tooltipTextColor: 'white'
 }
}

Visual Marker Options

  • markerColor (string): Color of the marker in the progress bar (default: '#ff6b6b')
  • markerTitle (string): Title to display in the marker tooltip
  • markerIcon (string): Icon to display in the marker (future feature)
  • tooltipBackgroundColor (string): Background color of the tooltip (default: 'rgba(0, 0, 0, 0.8)')
  • tooltipTextColor (string): Text color of the tooltip (default: 'white')

Events

The module triggers the following events:

  • quepoint: Triggered when any cue point is activated
  • quepoint:add: Triggered when a cue point is added
  • quepoint:remove: Triggered when a cue point is removed
  • quepoint:enable: Triggered when cue points are enabled
  • quepoint:disable: Triggered when cue points are disabled
  • quepoint:click: Triggered when a progress bar marker is clicked

API Methods

The module provides the following methods through the player instance:

// Add a cue point
player.cuePointsPlugin().addCuePoint({
 id: 'new-cue',
 time: 90,
 type: 'chapter',
 marker: {
 markerColor: '#E91E63',
 markerTitle: 'New Chapter'
 }
});

// Remove a cue point
player.cuePointsPlugin().removeCuePoint('new-cue');

// Get all cue points
const allCuePoints = player.cuePointsPlugin().getAllCuePoints();

// Get cue points by type
const chapters = player.cuePointsPlugin().getCuePointsByType('chapter');

// Enable/disable cue points
player.cuePointsPlugin().enable();
player.cuePointsPlugin().disable();

// Check if cue points are enabled
const isEnabled = player.cuePointsPlugin().isEnabled();

// Manually trigger a cue point by ID
player.cuePointsPlugin().triggerCuePointById('chapter-1', true); // force=true to trigger even if already triggered

// Clear triggered state for a specific cue point or all cue points
player.cuePointsPlugin().clearTriggeredState('chapter-1'); // Clear specific cue point
player.cuePointsPlugin().clearTriggeredState(); // Clear all cue points

Limitations

  • Cue points are not compatible with live streams (duration === Infinity)
  • Progress bar markers may not work correctly with custom progress bar implementations
  • Code execution cue points should be used carefully to avoid performance issues

Dash

DASH

The DASH module enables DASH (Dynamic Adaptive Streaming over HTTP) playback in KWIKplayer using Shaka Player configurations.

Initialization

To enable DASH support need to add in following options:

window.initPlayer('my-video', {
 shakaConfig: {
 abr: { enabled: false },
 drm: {
 servers: {
 'com.widevine.alpha': 'https://license-server.example.com',
 },
 clearKeys: {
 'key-id': 'key-value',
 },
 },
 manifest: {
 retryParameters: { maxAttempts: 3 },
 },
 streaming: {
 bufferingGoal: 30,
 rebufferingGoal: 15,
 },
 licenseServerAuth: async (a, b, c) => {
 console.log('Custom license server logic');
 },
 },
})

Options

OptionTypeDescription
abrAbrConfigurationConfigures adaptive bitrate streaming.
drmDrmConfigurationConfigures DRM options, including servers and keys.
manifestManifestConfigurationConfigures manifest retry parameters.
streamingStreamingConfigurationConfigures streaming buffer and rebuffering goals.
licenceServerAuthRequestFilterFunction to handle license server requests.

AbrConfiguration

OptionTypeDescription
enabledbooleanEnables or disables ABR (Adaptive Bitrate Streaming).

DrmConfiguration

OptionTypeDescription
advancedRecord<string, shaka.extern.AdvancedDrmConfiguration> | nullAdvanced DRM configuration for specific key systems.
clearKeysRecord<string, string>A map of clear key IDs to their corresponding keys.
servers`Record<string, string>A map of license servers for various key systems.

AdvancedDrmConfiguration

OptionTypeDescription
audioRobustnessstringSpecifies robustness for audio streams.
headersRecord<string, string>Sets custom headers for license requests.
sessionTypestringConfigures the session type.
videoRobustnessstringSpecifies robustness for video streams.

ManifestConfiguration

OptionTypeDescription
retryParametersRetryParametersRetry parameters for manifest fetching.

RetryParameters

OptionTypeDescription
maxAttemptsnumberRetry parameters for manifest fetching.

StreamingConfiguration

OptionTypeDescription
bufferBehindnumberTime (in seconds) of content to keep in buffer behind the playhead.
bufferingGoalnumberTarget buffer length (in seconds).
rebufferingGoalnumberBuffer length (in seconds) required before resuming playback after buffering.

RequestFilter

A function that processes a request before it is sent, allowing customization or filtering.

ParameterTypeDescription
anumberThe first argument, typically used for request type or identifier.
bRecord<string, any>The second argument, representing request parameters or headers.
cRecord<string, any>An optional third argument, often used for additional request context or data.
ReturnsPromise<any> | voidA promise resolving with a result or void for no asynchronous operations.

Design Studio

Design studio

This module allows users to customize the player's theme and add a custom logo. Users can modify the colors of the player's controls and progress bar, as well as set the logo's position, visibility, and link.

Features

  • Custom logo: Add a logo to the player with options for hiding during playback, setting its position, adding a link, and adjusting margins.
  • Theme customization: Change the primary, background, and progress bar colors for full control over the player’s appearance.

Limitations

The module is incompatible with the Podcast module. This will prevent the module from functioning as intended.

Initialization

window.initPlayer('my-video', {
 designStudioPlugin: {
 logo: {
 src: 'https://www.whitepeaks.co.uk/images/logo.webp',
 hide: true,
 link: 'https://www.whitepeaks.co.uk/en/',
 position: 'top-right',
 margin: 10,
 },
 colors: {
 primary: '#fff',
 highlight: 'red',
 background: '#2FA2FA',
 thumbContainerBg: '#2FA',
 playProgress: 'rgba(22,122,222, 50%)',
 loadProgress: '#000',
 progressHolder: '#999999',
 },
 },
})

Options

ModuleDesignStudio Options

OptionTypeDescription
logoobjectConfiguration for the logo displayed on the player.
srcstringURL of the logo image to be displayed on the player.
hidebooleanIf true, the logo will be hidden while the video is playing and will appear when paused.
linkstringURL to redirect when the logo is clicked.
position'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'Determines the position of the logo on the video player.
marginnumberMargin around the logo in pixels (px).
colorsobjectConfiguration for customizing player colors.
primarystringThe primary color for main elements on the player.
highlightstringColor for buttons and icons on hover.
backgroundstringBackground color of the control bar and buttons.
thumbContainerBgstringBackground color of the thumbnail container (e.g., for video preview).
playProgressstringColor of the progress bar showing the current playback position and volume level.
loadProgressstringBackground color of the progress bar representing the loaded (buffered) portion of the video.
progressHolderstringBackground color of the container holding the progress bar.

Google Analytics

Google Analytics

This plugin integrates Google Analytics and Google Tag Manager (gtag) with Video.js to enable tracking of video player events. It supports customizable event tracking, progress tracking, and debugging.

Initialization

To enable plugin need to add in following options:

window.initPlayer('my-video', {
 googleAnalyticsPlugin: {
 assetName: document.title,
 mode: 'GTAG',
 events: [
 {
 name: 'ended',
 label: 'video ended',
 action: 'ended',
 enabled: true,
 },
 {
 name: 'fullscreenchange',
 label: {
 open: 'video fullscreen open',
 exit: 'video fullscreen exit',
 },
 action: 'fullscreenchange',
 enabled: true,
 },
 ],
 },
})

Options

OptionTypeDescription
assetNamestringThe name of the asset being tracked (e.g., video title). Defaults to the document title if not specified.
debugbooleanEnables debug mode to log additional information to the console for troubleshooting.
mode'GA' '| 'GTAG'The tracking mode to use: GA for Google Analytics or GTAG for Google Tag Manager. If not specified, it is auto-detected based on gtag availability.
events{ name: string; action: string; label?: string | { open: string; exit: string }; enabled: boolean; }[]An array of objects representing events to be tracked. Each object includes:
  • name: The name of the event (e.g., 'play', 'pause', 'timeupdate').
  • action: The action associated with the event (e.g., 'Started Video').
  • label: An optional label for the event, which can be a string or an object with open and exit for fullscreen events.
  • enabled: A boolean indicating whether the event is enabled for tracking.

Hls

HLS

The HLS module enhances KWIKplayer by supporting HLS playback in browsers that lack native support (all except Safari).

Initialization

To enable HLS support need to add in following options:

window.initPlayer('my-video', {
 hlsPlugin: {
 hlsjsConfig: {
 levelSwitchStrategy: 'smooth'
 }
 }
})

Events

The HLS module triggers events for tracking playback and stream state:

  • codecsknown - Fired when audio and video codecs are identified.

Options

OptionTypeDefaultDescription
levelSwitchStrategysmooth | instant"smooth"Determines how quality levels switch during playback.
isChromiumAndroidbooleanAutomatically checks via the user agentOptimizes buffer management for Chromium-based browsers on Android devices.

HLS Tech Interface

OptionDescription
durationReturns the duration of the current media.
seekableProvides the seekable range as a TimeRange object.
disposeCleans up resources used by the HLS tech.

Example: Accessing the Seekable Range

const tech = player.tech();
const seekable = tech.hls?.seekable();
if (seekable) {
 console.log('Seekable Start:', seekable.start(0));
 console.log('Seekable End:', seekable.end(0));
}

Hotspots

Hotspots

The Hotspots module enables the addition of interactive elements (hotspots) to a video player, allowing you to display custom content like text, images, HTML, and links at specific times and locations in the video. This is useful for creating engaging and interactive video experiences.

How to Use

You can customize the look and behavior of each hotspot in the Hotspots Editor module, or do it manually, passing the array of objects with needed options to the hotspotsPlugin.

Note: For an enhanced UI/UX, you can use the Hotspots Editor Module to visually configure hotspots. Alternatively, configure them programmatically as described below.

Limitations

The module is incompatible with the Podcast module, audio-only mode, or the audio tag. Any of these configurations will prevent the module from functioning as intended. When casting is enabled, the hotspots may not appear on the screen.

Example usage

window.initPlayer('my-video', {
 hotspotsPlugin: [
 {
 left: 0.8,
 top: 0.019,
 width: 0.112,
 height: 0.196,
 start: '1.46',
 end: '56.48',
 type: 'none',
 border: {
 size: 8,
 color: '#ffffff',
 style: 'solid',
 radius: 72,
 },
 ico: {
 size: 10,
 color: '#000000',
 icoType: 'hotspot',
 },
 },
 {
 left: 0.45,
 top: 0.1,
 width: 0.2,
 height: 0.102,
 start: '3',
 end: '5',
 type: 'text',
 text: 'Text hotspot',
 textProps: {
 size: 2.4,
 color: '#CAD6D7',
 font: 'Concert One',
 },
 },
 {
 left: 0.09,
 top: 0.01,
 width: 0.406,
 height: 0.974,
 start: '5',
 end: '20',
 type: 'html',
 html: '<div style="background-color: #ffffff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); width: 90%; max-width: 600px;">\n <h2 style="color: #333; text-align: center;">Key Features of KwikPlayer</h2>\n <ul style="list-style-type: none; padding: 0; margin: 0;">\n <li style="display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #e0e0e0;">\n <span style="font-size: 1.5rem; color: #4caf50; margin-right: 15px;">🚀</span>\n <span style="font-size: 1rem; color: #555;">Fast Loading Times</span>\n </li>\n <li style="display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #e0e0e0;">\n <span style="font-size: 1.5rem; color: #4caf50; margin-right: 15px;">⚙️</span>\n <span style="font-size: 1rem; color: #555;">Customizable Player Controls</span>\n </li>\n <li style="display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #e0e0e0;">\n <span style="font-size: 1.5rem; color: #4caf50; margin-right: 15px;">📱</span>\n <span style="font-size: 1rem; color: #555;">Responsive for Mobile Devices</span>\n </li>\n <li style="display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #e0e0e0;">\n <span style="font-size: 1.5rem; color: #4caf50; margin-right: 15px;">📈</span>\n <span style="font-size: 1rem; color: #555;">Analytics Integration</span>\n </li>\n <li style="display: flex; align-items: center; padding: 15px;">\n <span style="font-size: 1.5rem; color: #4caf50; margin-right: 15px;">🔒</span>\n <span style="font-size: 1rem; color: #555;">Privacy Controls and Security</span>\n </li>\n </ul>\n </div>',
 },
 ],
})

Configuration

Each hotspot configuration requires the following common properties:

  • Positioning and Dimensions:
    • left (number): X-coordinate (relative, 0 to 1).
    • top (number): Y-coordinate (relative, 0 to 1).
    • width (number): Width of the hotspot (relative, 0 to 1).
    • height (number): Height of the hotspot (relative, 0 to 1).
  • Timing:
    • start (string): Start time in seconds.
    • end (string): End time in seconds.
  • Type-Specific Options: Custom properties based on the type of hotspot (e.g., text, html, link).

Hotspot Types and Examples

The module is written in TypeScript, ensuring type safety and enabling your IDE to assist with intelliSense. Once the type of a hotspot is specified, your IDE will suggest the available properties and their expected values, streamlining the configuration process.

HTML Hotspot

Displays custom HTML content at a specific position and time.

HTML Options:

  • html (string): Custom HTML content to be displayed within the hotspot.
  • title (string): Title text for the hotspot.
{
 type: 'html',
 html: '<div>Custom HTML Content</div>',
 title: 'HTML Hotspot',
 left: 0.1,
 top: 0.1,
 width: 0.2,
 height: 0.2,
 start: '5',
 end: '10',
}

Image Hotspot

Displays an image within the hotspot.

  • src (string): URL of the image to display within the hotspot.
{
 type: 'image',
 src: 'https://www.kwikmotion.com/player/Images/KWIKplayer.png',
 left: 0.5,
 top: 0.2,
 width: 0.15,
 height: 0.15,
 start: '5',
 end: '15',
}

Creates a clickable area that opens a link.

  • ico (HotspotIconOptions) - Icon settings to display an icon alongside the link.
  • link (string) - URL that opens when the hotspot is clicked.
  • title (string) - Title text for the hotspot.
{
 type: 'link',
 ico: { icoType: 'hotspot', size: 2.5, color: '#000' },
 link: 'https://www.whitepeaks.co.uk/en/',
 title: 'Clickable Link',
 left: 0.7,
 top: 0.1,
 width: 0.1,
 height: 0.1,
 start: '3',
 end: '12',
}

None Hotspot

Displays an icon without additional content or links.

  • ico (HotspotIconOptions) - Icon settings to display an icon alongside the link.
  • title (string) - Title text for the hotspot.
{
 type: 'none',
 ico: { icoType: 'aim', size: 1.5, color: '#ff0000' },
 title: 'Static Icon',
 left: 0.4,
 top: 0.4,
 width: 0.5,
 height: 0.5,
 start: '0',
 end: '20',
}

Page Hotspot

Opens a modal window containing an iframe when clicked.

  • ico (HotspotIconOptions) - Icon settings to display an icon alongside the link.
  • title (string) - Title text for the hotspot.
  • link (string) - URL that opens modal window with iframe when clicked.
{
 type: 'page',
 ico: { icoType: 'point', size: 2.5, color: '#000' },
 link: 'https://www.whitepeaks.co.uk/en/',
 title: 'Embedded Page',
 left: 0.3,
 top: 0.3,
 width: 0.12,
 height: 0.12,
 start: '6',
 end: '18',
}

Text Hotspot

  • text (string): Displayed text on the HotspotText component.
  • textProps (HotspotTextPropsOptions): Text styling options.
{
 type: 'text',
 text: 'Sample Text',
 textProps: { color: '#333', font: 'Arial', size: 1.6 },
 left: 0.15,
 top: 0.15,
 width: 0.1,
 height: 0.1,
 start: '4',
 end: '8',
}

Advanced Options.

Text Options (textProps)

Customize text appearance for text hotspots.

  • color (string): Text color (hex, RGB, or color name).
  • font (string): Font family.
  • size (number): Font size in em units.

Icon Options (ico)

Control the appearance of icons for specific hotspot types.

  • size: number - The icon's width and height in pixels.
  • color: string - Color in hex, RGB, or name format (only available for SVG icons).
  • icoType: IcoType - Type of icon ('point', 'photo-camera', 'aim', 'disappointment', 'hotspot').

Border Options (border)

Control the appearance of icons for specific hotspot types.

  • size: number - Border width in pixels.
  • radius: number - Border radius for rounded edges, in pixels.
  • color: string - Color of the border (hex, RGB, or color name).
  • style: string - Border style (e.g., 'solid', 'dashed', 'dotted').

Hotspots Editor

Hotspots Editor

The Hotspots Editor is an advanced module for the video.js framework that builds upon the Hotspots module, allowing users to not only display hotspots but also create, edit, and configure them dynamically within the video player. This module serves as an interactive extension, providing an intuitive interface for defining and modifying hotspot properties such as timing, position, size, and appearance.

Note: While the Hotspots module handles the display of hotspots, the Hotspots Editor enables their creation and editing. But it is not required enabling 2 modules at the same time.

Features

  • Multiple hotspot types (up to six types of hotspots):
    • html
    • image
    • link
    • none
    • page
    • text
  • Customizable appearance
    • Add borders to any hotspot type.
    • Set titles for page, html, none and link hotspots
    • Add icons to html, none and link hotspots
    • Choose from 13 different font families for text hotspots (modifiable in the code).
  • Flexible configuration
    • Define any size and duration for each hotspot within the video player boundaries.
    • Use the valuehandler option to either pass a textarea element ID or a function to handle the hotspots array data.

Limitations

The module is incompatible with the Podcast module, audio-only mode, or the audio tag. Any of these configurations will prevent the module from functioning as intended.

Usage

Options example

To handle hotspot data, use the valuehandler option. This can either:

  1. Link to a textarea element's ID to automatically update its content.
  2. Provide a custom function for processing the hotspots array.

Example 1: Using a Custom Function The example below demonstrates how to dynamically create and populate a textarea element with the hotspot data:

window.initPlayer('my-video', {
 hotspotsEditorPlugin: {
 valuehandler: (hotspots) => {
 const textarea = document.querySelector('.hotspot-output') as HTMLTextAreaElement | undefined;

 if (textarea) {
 textarea.value = JSON.stringify(hotspots);
 return;
 }

 const main = document.querySelector('main');
 if (!main) return;

 const newTextarea = main.appendChild(document.createElement('textarea'));
 newTextarea.setAttribute('class', 'hotspot-output');
 newTextarea.value = JSON.stringify(hotspots);
 },
 },
});

Example 2: Using a Predefined Textarea Element If you already have a textarea element on the page, simply pass its ID to the valuehandler option:

const player = videojs('my-video', {
 hotspotsEditorPlugin: {
 valuehandler: 'textarea',
 },
});

Ima

IMA

Introduction

The KWIKplayer IMA Plugin integrates the Google Interactive Media Ads (IMA) SDK with KWIKplayer, enabling seamless ad playback in formats such as VAST, VMAP, or ad rules.


Configuration Options

The plugin provides several configuration options to customize its behavior. Below is a list of the supported options:

OptionTypeDefaultDescription
adLabelstring"Advertisement"Replaces the "Advertisement" text in the ad label.
adLabelNofNstring"of"Replaces the "of" text in the ad label (e.g., 1 of 2).
adTagUrlstringnullURL for fetching a VAST, VMAP, or ad rules response. Overrides adsResponse and adsSchedule.
adsRenderingSettingsobject{}Ads rendering settings as defined in the IMA SDK.
adsResponsestringnullVAST/VMAP/ad rules response used instead of adTagUrl.
adsScheduleobjectnullAd scheduling configuration. Allows VMAP construction automatically.
adsRequestobject{}Ad request properties defined in the IMA SDK.
autoPlayAdBreaksbooleantrueAutomatically plays VMAP/ad rules ad breaks.
contribAdsSettingsobject{}Additional settings for the contrib-ads plugin.
debugbooleanfalseEnables or disables debug mode.
disableAdControlsbooleanfalseHides ad controls (play/pause, volume, fullscreen) during ad playback.
disableCustomPlaybackForIOS10PlusbooleanfalseDisables custom playback on iOS 10+ browsers.
disableFlashAdsbooleanfalseDisables Flash ads.
forceNonLinearFullSlotbooleantrueForces non-linear ads to render as linear fullslot.
localestringnullSets the locale for ad localization.
numRedirectsnumbernullMaximum number of VAST redirects before aborting the ad load.
preventLateAdStartbooleanfalsePrevents ads from starting late after content playback begins.
showControlsForJSAdsbooleantrueDisplays the control bar for VPAID JavaScript ads.
showCountdownbooleantrueShows the ad countdown timer.
vastLoadTimeoutnumber5000Overrides the VAST load timeout in milliseconds for a single wrapper.
vpaidMode"ENABLED" | "DISABLED" | "INSECURE""ENABLED"VPAID mode configuration. Overrides vpaidAllowed.

Usage

To enable the IMA plugin, include its configuration under the imaPlugin key when initializing KWIKplayer:

const player = window.kwikMotion('my-video', {
 imaPlugin: {
 adTagUrl: 'https://example.com/vast.xml',
 autoPlayAdBreaks: true,
 showCountdown: true,
 debug: false,
 }
})

Ad Scheduling

The adsSchedule option allows you to define a schedule for preroll, midroll, and postroll ads:

window.initPlayer('my-video', {
 imaPlugin: {
 adsSchedule: {
 preroll: ['https://example.com/preroll.xml'],
 30: ['https://example.com/midroll.xml'], // Midroll at 30 seconds
 postroll: ['https://example.com/postroll.xml'],
 },
 }
})

Events

The plugin emits various events to help you monitor ad behavior: Key Events

  • ads-ad-started
  • adstart
  • adend
  • adskip
  • adtimeout
  • adsready
  • nopreroll
  • nopostroll
  • contentplay
  • adserror

Example

player.on('ads-ad-started', () => {
 console.log('Ad started!');
});

Debugging

Enable debugging to log detailed information about the plugin's behavior:

window.initPlayer('my-video', {
 imaPlugin: {
 debug: true,
 }
})

Ima Dai

IMA DAI

Introduction

The KWIKplayer IMA DAI Plugin integrates Dynamic Ad Insertion (DAI) with the KWIKplayer using Google's IMA SDK. This plugin enables seamless ad playback in live and Video on Demand (VOD) streams while providing options for stream configuration, localization, and ad behavior customization.


Configuration Options

The plugin accepts the following configuration options:

OptionTypeDefaultDescription
isLiveStreambooleanfalseIndicates if the stream is a live stream.
streamFormat'hls' | 'dash''hls'Format of the stream. Only 'hls' is supported.
assetKeystringnullIdentifier for live stream assets. Required for live streams.
cmsIdstringnullCMS ID for VOD streams. Required for VOD streams.
videoIdstringnullVideo ID for VOD streams. Required for VOD streams.
adTagParametersobject{}Parameters for ad tag requests.
apiKeystringnullAPI key for stream access.
authTokenstringnullAuthorization token for requests.
bookmarkTimenumbernullStart time of the content in seconds, for resuming playback.
fallbackStreamUrlstringnullFallback stream URL in case of primary stream failure.
localestringnullLocale for content localization (e.g., en-US).
streamActivityMonitorIdstringnullMonitoring ID for debugging and tracking stream activity.

Events

The plugin triggers specific events during its lifecycle:

EventDescription
stream-managerEmitted when the stream manager is initialized.
stream-requestEmitted when a stream request is initiated.

Usage

Initialization

To initialize the plugin, configure the imaDaiPlugin options in the KWIKplayer settings:

window.initPlayer('my-video', {
 imaDaiPlugin: {
 isLiveStream: true,
 streamFormat: 'hls',
 assetKey: 'your-live-asset-key',
 adTagParameters: {
 someParameter: 'value',
 },
 locale: 'en-US',
 },
})

Kwik Analytics

KWIK Analytics

This module is a custom Video.js plugin that integrates with the Kwikstat analytics system to track player events and user interactions, such as playback, ads, and quality changes. It leverages the Piwik tracker, ensuring accurate reporting of video performance and user behavior.

Initialization

To enable plugin need to add in following option:

window.initPlayer('my-video', {
 kwikAnalyticsPlugin: {
 category: 'player-v9',
 mediaId: 'id0',
 url: `${document.location.protocol === 'https:' ? 'https' : 'http'}://stat.kwikmotion.com/`,
 events: ['adserror', 'ads-ad-started', 'timeupdate', 'ended', 'loadedmetadata'],
 title: document.title,
 interval: 5,
 userId: 'user-test-id',
 }
})

Options

OptionTypeDescription
categorystringA category name to group media analytics data.
mediaIdstringIdentifier for the media being played.
urlstringURL to associate with the playback session.
eventsKwikPlayer.Player.Event[]List of events to track (e.g., play, pause, ended).
intervalnumberTime interval (in seconds) for periodic data capture (e.g., time updates).
titlestringMedia title for identification in analytics.
userIdstringIdentifier for the user consuming the media.

Mp3 Podcast

Podcast

This module provides a customizable audio player with unique progress bar visualizations and extensive styling options. Designed for enhanced playback experiences, it includes options for displaying metadata, configuring playback controls, and customizing player themes.

Features

  • Custom Progress Bar: Choose between visualizations based on the audio buffer or a randomized wave, with styles 'rounded' and 'lacerated'.
  • Header Customization: Add a title, subtitle, and image to the player header.
  • Volume and Speed Control: Change volume and playback playing.
  • Time Displays: Enable displays for current time, remaining time, and duration.
  • Additional Buttons: Include options for skip (forward/backward), share, playback speed, and download buttons.
  • Theme and Style Customization: Adjust colors, tooltip styles, and other visual elements to match your design.

Requires player tag to be audio.

Usage Example

window.initPlayer('my-video', {
 tag: 'audio',
 podcastPlugin: {
 progressBar: {
 wave: 'lacerated',
 },
 title: 'Default podcast title',
 poweredBy: {
 link: 'https://www.kwikmotion.com/KWIKplayer/7/en',
 logo: 'https://www.kwikmotion.com/images/KWIKmotionLogo.png',
 title: 'Powered by KWIKmotion',
 },
 podcastDesignStudio: {
 progressHolderColor: 'black',
 background: 'transparent',
 playProgressColor: 'orange',
 controlsColor: 'orange',
 textColor: 'orange',
 themeColor: 'blue',
 tooltipBgColor: 'black',
 tooltipTextColor: 'white',
 },
 volume: {
 enable: true,
 },
 speed: {
 enable: true,
 },
 },
});

Podcast Module Options

The Podcast module offers extensive customization through the following options:

General Options

  • title (string): The title displayed for the podcast player.
  • titleWrapperClass (string): CSS class name applied to the wrapper containing the title.
  • subtitle (string): The subtitle displayed for the podcast player.
  • subtitleWrapperClass (string): CSS class name applied to the wrapper containing the subtitle.
  • image (string): URL or path to the image associated with the podcast player.
  • imageWrapperClass (string): CSS class name applied to the wrapper containing the image.

Powered By

poweredBy

  • link (string): URL link for the "powered by" section.
  • logo (string): URL or path to the logo displayed in the "powered by" section.
  • title (string): Title or text displayed in the "powered by" section.
  • wrapperClass (string): CSS class name applied to the wrapper containing the "powered by" section.

Design Options

podcastDesignStudio

  • themeColor (string): Primary theme color for the podcast player.
  • background (string): Background color for the podcast player.
  • progressHolderColor (string): Color for the progress bar holder.
  • playProgressColor (string): Color for the progress indicating playback.
  • controlsColor (string): Color used for control icons and buttons.
  • textColor (string): Text color used in the player.
  • tooltipBgColor (string): Background color for tooltips.
  • tooltipTextColor (string): Text color used in tooltips.

Download Options

download

  • enable (boolean): Enables or disables the download button.
  • text (string): Text displayed on the download button.
  • downloadName (string): Default name for the downloaded audio file.
  • wrapperClass (string): CSS class name applied to the wrapper containing the download button.

Share Options

share

  • enable (boolean): Enables or disables the share button.
  • text (string): Text displayed on the share button.
  • wrapperClass (string): CSS class name applied to the wrapper containing the share button.

Speed Control

speed

  • enable (boolean): Enables or disables the speed control button.
  • text (string): Text displayed on the speed control button.
  • wrapperClass (string): CSS class name applied to the wrapper containing the speed control button.
  • defaultPlaybackRate (number): Default playback speed (e.g., 1.0 for normal speed).

Volume Control

volume

  • enable (boolean): Enables or disables the volume control.
  • wrapperClass (string): CSS class name applied to the wrapper containing the volume control.

Skip Controls

skipControls

  • Forward Skip:
    forward
    • enable (boolean): Enables or disables the forward skip control.
    • text (string | function): Text displayed for the forward skip control. Can be a string or a function.
      Example: "Skip 15 seconds" or (value) => \Skip ${value} seconds`.
    • wrapperClass (string): CSS class name applied to the wrapper containing the forward skip control.
  • Backward Skip
    backward:
    • enable (boolean): Enables or disables the backward skip control.
    • text (string | function): Text displayed for the backward skip control. Can be a string or a function.
      Example: "Rewind 15 seconds" or (value) => \Rewind ${value} seconds`.
    • wrapperClass (string): CSS class name applied to the wrapper containing the backward skip control.

Progress Bar Options

progressBar

  • wave ('rounded' | 'lacerated'): Style of the wave in the progress bar.
  • waveBasedOnAudioBuffer (boolean): Whether the progress bar wave is based on the audio buffer.

Time Displays

timeDisplays

  • currentTimeDisplay (boolean): Enables or disables the display of the current playback time.
  • currentTimeDisplayWrapperClass (string): CSS class name applied to the wrapper containing the current time display.
  • durationDisplay (boolean): Enables or disables the display of the total duration.
  • durationDisplayWrapperClass (string): CSS class name applied to the wrapper containing the duration display.
  • remainingTimeDisplay (boolean): Enables or disables the display of the remaining playback time.
  • remainingTimeDisplayWrapperClass (string): CSS class name applied to the wrapper containing the remaining time display.

Audio File

  • file (string): URL of the audio file to be played.

Npaw Analytics

NPAW Analytics

The NPAW Analytics module integrates NPAW (Nice People At Work) analytics with KWIKplayer to provide detailed playback insights and monitoring.

Initialization

To enable the NPAW Analytics plugin, provide the following options during player initialization:

window.initPlayer('my-video', {
 npawAnalyticsPlugin: {
 debug: true,
 'content.channel': 'Sports Channel',
 'content.contractedResolution': '1080p',
 'content.cost': '9.99',
 'content.customDimension.1': '1',
 'content.customDimension.2': 'CDN Title',
 'content.episodeTitle': 'Episode 1',
 'content.genre': 'Drama, Thriller',
 'content.id': '12345',
 'content.price': '1.99',
 'content.season': '2',
 'content.title': 'Great Series - Episode 1',
 'content.tvShow': 'Great Series',
 'content.type': 'episode',
 'user.name': 'user123',
 }
})

Options

Mandatory Options

The following options should be provided to ensure the plugin works correctly:

OptionTypeDescription
content.channelstringTitle of the content's channel.
content.titlestringCompound title (e.g., "Asset Title - Video Title").
content.idstringUnique ID of the content (equivalent to mediaId).
user.namestringUser ID or 0 for guests.

Optional Options

You can enhance the analytics tracking by including the following metadata:

OptionTypeDescription
debugbooleanEnables debug mode on window.NpawPlugin.
content.contractedResolutionstringVideo resolution based on user subscription.
content.coststringCost associated with SVOD packages.
content.customDimension.1'0' | '1'Indicates monetization presence (AVOD, SVOD, TVOD, FVOD).
content.customDimension.2stringCDN title for the content.
content.episodeTitlestringTitle of the episode or video.
content.genrestringVideo genres as a comma-separated list.
content.pricestringPrice associated with TVOD packages.
content.seasonstringSeason ID of the content.
content.tvShowstringTitle of the asset or TV show.
content.type'promo'| 'trailer'| 'episode'Type of video.
content.isLivebooleanLive content state.

DRM Support

The plugin detects and adapts to DRM configurations automatically. If DRM is enabled, the content.drm option is set to 'drm'; otherwise, it defaults to 'no drm'.

Ads Tracking

The NPAW Analytics module integrates with ads through the following:

  • IMA Adapter: Tracks Google IMA ad events.
  • DAI Adapter: Tracks Dynamic Ad Insertion (DAI) events.

Panorama

Panorama module

The Panorama module is a TypeScript-based enhancement for integrating 360° video playback with support for multiple video types, including:

  • Equirectangular
  • Fisheye
  • 3D Video
  • Dual Fisheye

It includes a button for enabling Cardboard-VR mode, delivering an immersive viewing experience.

Leveraging the THREE.js library, a custom WebGL-based canvas renders the video source as a panoramic view. Developers can easily customize playback and interaction settings to suit diverse use cases.

Limitations

The module is incompatible with the Podcast module, audio-only mode, or the audio tag. Any of these configurations will prevent the module from functioning as intended.

Customization Options

You can configure the following options to tailor the video experience:

  • clickAndDrag: Enables video rotation on drag-and-drop instead of mouse rollover.
  • showNotice: Displays an instructional message to guide users about interacting with the video.
  • initFov: Sets the initial field of view for the video.
  • maxFov / minFov: Define the range of zoom levels for the video.
  • initLat / initLon: Configure the initial camera position with latitude and longitude angles.
  • backToVerticalCenter / backToHorizonCenter: Automatically return to center alignment when interaction stops.
  • VREnable: Displays a VR button to toggle Cardboard-VR mode.
  • videoType: Specify the type of video (e.g., 'equirectangular', 'fisheye', '3dVideo', 'dual_fisheye').
  • NoticeMessage: Customize the instructional message text or use an HTML element for rich content.
  • autoHideNotice: Sets the duration (in milliseconds) for which the instructional message is displayed.
  • scrollable: Allows users to scroll within the video for additional navigation.
  • returnStepLat / returnStepLon: Configure the speed at which the view returns to vertical or horizontal center when auto-centering is enabled.
  • clickToToggle: Enables toggling video play/pause by clicking.
  • minLat / maxLat: Define the minimum and maximum latitude for camera angles.
  • minLon / maxLon: Set the longitude angle range.
  • rotateX / rotateY / rotateZ: Specify initial rotation angles for the video view around the respective axes.
  • autoMobileOrientation: Automatically adjusts the video based on mobile device orientation.
  • mobileVibrationValue: Sensitivity of vibration-based video interactions on mobile devices.
  • VRGapDegree: Sets the gap degree for VR mode to optimize viewing comfort.
  • closePanorama: Indicates whether the panorama view should be closed.
  • helperCanvas: Configure a helper canvas for rendering support.
  • dualFish: Set parameters for dual fisheye layouts, including circle and layout configurations.

For more information see type interface

Example

window.initPlayer('my-video', {
 sources: [
 {
 src: '/assets/fisheye.mp4',
 type: 'video/mp4',
 },
 ],
 panoramaPlugin: {
 videoType: 'fisheye',
 maxLat: -10,
 initLat: -10,
 initLon: -270,
 rotateX: -Math.PI,
 },
})

Playlist

Playlist

It is a standalone utility for managing video playlists in applications using Video.js. It provides functionality to handle playlist items, manage navigation, repeat/shuffle functionality, and trigger custom events when the playlist state changes.

Initialization

To enable plugin need to add in following option:

window.initPlayer('my-video', {
 playlistPlugin: {
 autoplay: true,
 items: [
 {
 sources: [
 {
 src: 'http://media.w3.org/2010/05/sintel/trailer.mp4',
 type: 'video/mp4'
 }
 ],
 poster: 'https://image.mux.com/5g1hMA6dKAe8DCgBB901DYB200U65ev2y00/thumbnail.jpg?time=43',
 title: 'The title of the episode in the playlist, long title is placed here, the title of',
 duration: '12m'
 },
 {
 sources: [
 {
 src: 'https://embed.kwikmotion.com/VideosThumbsImages/demo/1900000/lSKPxmHWQxIQRIQIrdxgQ-20-Encoded-99449564-360p-5425v.mp4',
 type: 'video/mp4'
 }
 ],
 poster: 'https://embed.kwikmotion.com/VideosThumbsImages/demo/1900000/Poster-UWe2eUYN2jkyPBkHHgGwaw-20-189030739-1.jpg',
 title: 'The Enigmatic Yonaguni Monument / The Enigmatic Yonaguni Monument / The Enigmatic Yonaguni Monument / The Enigmatic Yonaguni Monument',
 duration: '4m 52s'
 },
 {
 sources: [
 {
 src: 'https://clvod.itworkscdn.net/itwvod/smil:itwfcdn/demo/1998418-2AVJS3l77X8WF84.smil/playlist.m3u8'
 }
 ],
 poster: 'https://embed.kwikmotion.com/VideosThumbsImages/demo/1900000/Poster-58hLnfYY6FHbtEOXxK9RNw-20-948017507-1.jpg',
 title: 'Wave Watchers - The Art of Wave Photography',
 duration: '3m'
 },
 {
 sources: [
 {
 src: 'https://clvod.itworkscdn.net/itwvod/smil:itwfcdn/demo/1981200-B2MGj2571UIT48Q.smil/manifest.mpd'
 }
 ],
 poster: 'https://embed.kwikmotion.com/VideosThumbsImages/demo/1900000/Poster-k8XJwHE1i3S8HsGcueFu9Q-20-472728544-1.jpg',
 title: 'Contestant pairs must demonstrate skill as they endure seemingly simple tasks while confined in The Cube, an intimidating glass box with its own mind and attitude, in the hope of winning a major cash prize.',
 duration: '31 second'
 },
 {
 sources: [
 {
 src: 'https://clvod.itworkscdn.net/itwvod/smil:itwfcdn/demo/2146802-0K7HJO02HU6uV3r.smil/playlist.m3u8'
 }
 ],
 poster: 'https://embed.kwikmotion.com/VideosThumbsImages/demo/2100000/Poster-moaVC3LoNV54kER1i7O9bg-20-84995324-1.jpg',
 title: 'FAUL-2703 - FAUL-2703'
 },
 {
 sources: [
 {
 src: 'https://clvod.itworkscdn.net/itwvod/smil:itwfcdn/demo/2149575-cQL461C562HM8K3.smil/playlist.m3u8'
 }
 ],
 poster: 'https://embed.kwikmotion.com/VideosThumbsImages/demo/2100000/Poster-y6kDXw6K5U8qgTwt5oRHA-20-551803395-1.jpg',
 title: 'LONG MOVIE'
 },
 {
 sources: [
 {
 src: 'http://media.w3.org/2010/05/bunny/trailer.mp4',
 type: 'video/mp4'
 }
 ],
 poster: 'https://staging.faulio.com/storage/mediagallery/a6/22/big_680484a161e010ca50a229666448700f29463294.jpg',
 title: 'I know nothing about it',
 duration: '1333h'
 }
 ],
 title: 'Play next'
 }
});

Options

Playlist Options Interface:

OptionTypeDescription
autoplaybooleanWhether the playlist should autoplay the next item. Defaults to false.
autoplayDelaynumberDelay in seconds before autoplaying the next item. Defaults to 2 if autoplay is true.
titlestringTitle of the playlist, displayed if specified.
itemsPlaylistItem[]Array of playlist items.

PlaylistItem Options Interface:

OptionTypeDescription
durationstringDuration of the video (e.g., 00:03:45)
titlestringTitle of the video in the playlist item.
optionsKwikPlayer.OptionsOptions to be applied to the player for a specific playlist item.

Passing options for components other than the share-button may cause issues in the player.

Limitations

The following parameters must be applied initially to the player: tag, podcastPlugin, playlistPlugin, imaDaiPlugin, hotspotsEditorPlugin, chromecastPlugin, airplayPlugin, adblockPlugin.

Passing these options in the PlaylistItem options may lead to instability in the player.

Events

Event NameDescription
playlist:changeTriggered after the playlist items are updated.
playlist:itemTriggered after the playlist items are updated.
playlist:addTriggered when new items are added to the playlist.
playlist:removeTriggered when items are removed from the playlist.
playlist:sortedTriggered after sorting, reversing, or shuffling the items.
playlist:repeatTriggered on activating / disabling the playlist repeat state.

Safari Hls

Safari HLS

The Safari HLS module is designed for enabling HLS playback on Safari, supporting both standard and DRM-protected streams. This plugin integrates seamlessly with the KWIKplayer ecosystem, offering smooth playback on Apple's browser.

Initialization

To enable Safari HLS support, configure the player options as follows:

window.initPlayer('my-video', {
 safariHlsPlugin: {
 drm: {
 certificateUrl: 'https://example.com/certificate',
 keySystem: 'com.apple.fps.1_0',
 licenseUrl: 'https://example.com/license,
 },
 }
})

Options

OptionTypeDescription
certificateUrlstringURL for the DRM server's FairPlay certificate.
keySystemstringThe DRM key system to use. Defaults to 'com.apple.fps.1_0'.
licenseUrlstringURL for the license server to obtain decryption keys.

FAQs

FAQs

  • What is KWIKplayer?
    KWIKplayer is an advanced video player built on top of the Video.js framework, offering additional customization and functionality for modern video delivery needs.
  • What features does KWIKplayer offer beyond standard Video.js?
    KWIKplayer provides enhanced branding options, analytics integration, custom theming, advanced DRM support, adaptive streaming, and interactive overlays.
  • What browsers and devices are supported by KWIKplayer?
    KWIKplayer is compatible with the following minimum browser versions:
    • Google Chrome: Version 60 (Released July 2017)
    • Mozilla Firefox: Version 63 (Quantum) (Released October 2018)
    • Microsoft Edge: Version 80 (Released February 2020)
    • Apple Safari: Version 11 (Released September 2017)
    • Opera: Version 50 (Released February 2018)
  • Does KWIKplayer support streaming protocols like HLS and DASH?
    Yes, KWIKplayer supports HLS (HTTP Live Streaming) and MPEG-DASH for adaptive streaming.
  • Can I use plugins with KWIKplayer?
    You can use it accordingly docs. Please go to the module (plugin) you need to use.
  • How can I track video analytics with KWIKplayer?
    You can use Google Analytics, KWIKanalytics and NPAW plugins to track player statistics. Please follow dedicated docs section to know how to use specific plugin.
  • How do I handle autoplay restrictions?
    Autoplay restrictions are implemented by modern browsers to enhance user experience and prevent intrusive behavior. These policies generally block autoplaying videos with sound unless the user explicitly interacts with the page or grants permission.
    If the autoplay option is set to play, muted, or any value, KWIKplayer defaults to autoplay with the player muted. This ensures compliance with modern browser policies.
  • Does KWIKplayer support accessibility (e.g., captions, keyboard navigation)?
    KWIKplayer ensures accessibility with:
    • WebVTT Captions: Built-in support for captions.
    • Keyboard Navigation: Full playback control via keyboard shortcuts.
    • Screen Reader Compatibility: Optimized for screen readers with ARIA roles.
  • Which DRM systems does the player support?
    • Our player supports major DRM technologies, including Widevine (Google), PlayReady (Microsoft), and FairPlay (Apple), ensuring compatibility across multiple platforms and devices.
  • Does the player support multiple DRM systems simultaneously?
    • Yes, our player uses multi-DRM solutions to automatically select the appropriate DRM system based on the user’s browser and device.
  • Does the player support IMA ads?
    • Yes, our player supports Google Interactive Media Ads (IMA) SDK for serving pre-roll, mid-roll, and post-roll ads, as well as companion and overlay ads.
  • How does the player handle ad blockers?
    • The module identifies the presence of ad-blocking extensions. When an adblocker is detected, the plugin triggers a technical error and displays an unclosable modal with an error message
🔄

Migration Guide

Migration guide

Plugin-related configurations (modules) now require the word Plugin at the end of their respective property names (e.g., adblocker is now adblockPlugin, podcast is now podcastPlugin). This change ensures consistency across the API and better reflects their modular structure.

Design studio

The design studio configuration has been enhanced for better organization and functionality. The logo options are now part of the designStudio group, allowing for more customization, including an optional link. Additionally, color options have been consolidated into a colors object for clarity and easier management. These changes improve maintainability and streamline customization.

Before update

 window.initPlayer('my-video', {
 logo: {
 file: string,
 hide: boolean,
 position: 'top-right',
 margin: string,
 },
 designStudio: {
 primary: string,
 highlight: string,
 background: string,
 thumbContainerBG: string,
 playProgressColor: string,
 loadProgressColor: string,
 progressHolderColor: string,
 }
 })

After update

 window.initPlayer('my-video', {
 designStudio: {
 logo: {
 src: string,
 hide: boolean,
 link: string,
 position: 'top-right',
 margin: 2,
 },
 colors: {
 primary: string,
 highlight: string,
 background: string,
 thumbContainerBg: string,
 playProgress: string,
 loadProgress: string,
 progressHolder: string,
 }
 }
 })

Podcast

The podcast plugin has been streamlined by consolidating and reorganizing options. Some redundant or unnecessary options have been removed, and the skip controls now support dynamic text via a function that returns the current skip button value.

Before update

 window.initPlayer('my-video', {
 podcast: {
 title: string,
 titleWrapperClass: string,

 subtitle: string,
 subtitleWrapperClass: string,

 image: string,
 imageWrapperClass: string,

 // powered by
 poweredByLink: string,
 poweredByLogo: string,
 poweredByTitle: string,
 poweredByWrapperClass: string,

 // design studio
 background: string,
 progressHolderColor: string,
 playProgressColor: string,

 // podcast design studio
 themeColor: string,
 themeColor: string,
 direction: string,
 controlsColor: string,
 textColor: string,
 tooltipBgColor: string,
 tooltipTextColor: string,

 // download control
 enableDownload: boolean,
 downloadButtonText: string,
 audioDownloadName: string,
 downloadButtonWrapperClass: string,

 // share control
 enableShare: boolean,
 shareButtonText: string,
 shareButtonWrapperClass: string,

 // speed control
 enableSpeed: boolean,
 speedButtonText: string,
 defaultPlaybackRate: number
 playbackRates: number[],
 speedButtonWrapperClass: string,

 // volume control
 volumeControl: boolean,
 volumeControlWrapperClass: string,
 volumeControlDirection: string,

 // skip controls
 plusSkipControl: boolean,
 plusSkip: number,
 plusSkipText: string,
 plusSkipControlWrapperClass: string,
 minusSkipControl: boolean,
 minusSkip: number,
 minusSkipText: string,
 minusSkipControlWrapperClass: string,

 // progress bar
 wave: 'rounded',
 waveBasedOnAudioBuffer: boolean,

 // time displays
 currentTimeDisplay: boolean,
 currentTimeDisplayWrapperClass: string,
 durationDisplay: boolean,
 durationDisplayWrapperClass: string,
 remainingTimeDisplay: boolean,
 remainingTimeDisplayWrapperClass: string,
 }
 })

After update

 window.initPlayer('my-video', {
 podcastPlugin: {
 title: string,
 titleWrapperClass: string,

 subtitle: string,
 subtitleWrapperClass: string,

 image: string,
 imageWrapperClass: string,

 poweredBy: {
 link: string,
 logo: string,
 title: string,
 wrapperClass: string,
 },

 podcastDesignStudio: {
 themeColor: string,
 background: string,
 progressHolderColor: string,
 playProgressColor: string,
 controlsColor: string,
 textColor: string,
 tooltipBgColor: string,
 tooltipTextColor: string,
 },

 download: {
 enable: boolean,
 text: string,
 downloadName: string,
 wrapperClass: string,
 },

 share: {
 enable: boolean,
 text: string,
 wrapperClass: string,
 },

 speed: {
 enable: boolean,
 text: string,
 wrapperClass: string,
 defaultPlaybackRate: number,
 },

 volume: {
 enable: boolean,
 wrapperClass: string,
 },

 skipControls: {
 forward: {
 enable: boolean,
 text: string | ((value: number) => `skip ${value} seconds`),
 wrapperClass: string,
 },

 backward: {
 enable: boolean,
 text: string | ((value: number) => `rewind ${value} seconds`),
 wrapperClass: string,
 },
 },

 progressBar: {
 wave: 'rounded',
 waveBasedOnAudioBuffer: boolean,
 },

 timeDisplays: {
 currentTimeDisplay: boolean,
 currentTimeDisplayWrapperClass: string,
 durationDisplay: boolean,
 durationDisplayWrapperClass: string,
 remainingTimeDisplay: boolean,
 remainingTimeDisplayWrapperClass: string,
 },

 file: string,
 }
 })

Share component

The share functionality has been updated to allow greater md:flexibility and customization. You can now control whether to add the share button to the control bar, place it elsewhere, and include a broader range of customization options.

Before update

 window.initPlayer('my-video', {
 sharingSocials: [
 'fbButton',
 'linkedin',
 'mail'
 'messenger',
 'ok',
 'telegram',
 'tw',
 'viber',
 'vk',
 'whatsapp',
 ],
 sharing: string,
 })

After update

 window.initPlayer('my-video', {
 socials: [
 'facebook',
 'linkedin',
 'email',
 'messenger',
 'telegram',
 'twitter',
 'viber',
 'whatsapp',
 'pinterest',
 'reddit',
 ],
 addButtonToControlBar: boolean,
 buttonPositionIndex: number,
 description: string,
 embedCode: string,
 fbAppId: string,
 image: string,
 mobileVerification: boolean,
 redirectUri: string,
 showEmbedCode: boolean,
 title: string,
 url: string,
 })

Adblocker module

The adblocker module has been improved to allow for an optional errorMessage. This message will be displayed when ad blockers are detected, providing a more user-friendly way to handle such scenarios.

Before update

 window.initPlayer('my-video', {
 adblocker: boolean,
 })

After update

 window.initPlayer('my-video', {
 adblockPlugin: {
 errorMessage: string,
 }
 })

Playlist module

The playlist module has been updated and renamed to playlistPlugin. While adschedule is not yet supported, the new structure introduces improved options for better md:flexibility . Playlists are now configured under items, with enhanced properties such as poster and tracks. Additional settings like autoplay, autoplayDelay, and playlistElementId provide more control over playlist behavior.

Before update

 window.initPlayer('my-video', {
 playlist: [{
 image: string,
 sources: [{...}],
 title: string,
 mediaid: string,
 adschedule: {...}
 }]
 })

After update

 window.initPlayer('my-video', {
 playlistPlugin: {
 items: [{
 poster: string,
 sources: [{...}],
 title: string, // Item title
 duration: string,
 tracks: [{...}]
 }],
 autoplay: boolean,
 autoplayDelay: number, // delay in seconds
 playlistElementId: string,
 title: string, // Playlist title
 }
 })

Google VR (Panorama) module

In KWIKplayer v9, the panorama module has been greatly enhanced. Unlike KWIKplayer v8, which required the 'monoscopic' stereomode, the new configuration now allows more control over the camera settings, giving you the ability to adjust various parameters to suit your needs.

The new panoramaPlugin offers additional customization for user interaction (such as mobile support), video zooming, and VR mode toggling. You also have control over the field of view (FOV), initial position, and the ability to fine-tune the panorama behavior with parameters like clickAndDrag, autoMobileOrientation, and more.

The default settings are provided in this example, and if no changes are needed, you can simply pass an empty object.

Before update

 window.initPlayer('my-video', {
 stereomode: 'monoscopic',
 })

After update

 window.initPlayer('my-video', {
 panoramaPlugin: {
 clickAndDrag: isMobile, // boolean
 showNotice: true,
 NoticeMessage: isMobile // boolean
 ? 'Please drag and drop the video'
 : 'Please use your mouse drag and drop the video',
 autoHideNotice: 3000,

 // limit the video size when user scroll.
 scrollable: true,
 initFov: 75,
 maxFov: 105,
 minFov: 51,

 // initial position for the video
 initLat: 0,
 initLon: -180,

 // A float value back to center when mouse out the canvas. The higher, the faster.
 returnStepLat: 0.5,
 returnStepLon: 2,
 backToVerticalCenter: !isMobile, // boolean
 backToHorizonCenter: !isMobile, // boolean
 clickToToggle: false,

 // limit viewable zoom
 minLat: -85,
 maxLat: 85,

 minLon: -Infinity,
 maxLon: Infinity,

 videoType: 'equirectangular',

 rotateX: 0,
 rotateY: 0,
 rotateZ: 0,

 autoMobileOrientation: false,
 mobileVibrationValue: mobile ? 0.022 : 1,

 VREnable: true,
 VRGapDegree: 2.5,

 closePanorama: false,

 helperCanvas: {},

 dualFish: {
 width: 1920,
 height: 1080,
 circle1: {
 x: 0.240625,
 y: 0.553704,
 rx: 0.23333,
 ry: 0.43148,
 coverX: 0.913,
 coverY: 0.9,
 },
 circle2: {
 x: 0.757292,
 y: 0.553704,
 rx: 0.232292,
 ry: 0.4296296,
 coverX: 0.913,
 coverY: 0.9308,
 },
 },
 }
 })

Chromecast

In KWIKplayer v9, the Chromecast module is no longer enabled by default. To activate it, you must now pass the chromecastPlugin options. This provides greater control over when and how Chromecast is used within the player. You can specify the receiverAppID, choose to add the Chromecast button to the control bar, and control its position by setting buttonPositionIndex. These updates offer more customization and md:flexibility in the user experience.

 window.initPlayer('my-video', {
 chromecastPlugin: {
 receiverAppID: string,
 addButtonToControlBar: boolean,
 buttonPositionIndex: 16,
 }
 })

Airplay

Similar to the Chromecast module, the Airplay functionality in KWIKplayer v9 now requires explicit activation. You need to use the airplayPlugin options to enable it. This allows you to manage whether the Airplay button is displayed in the control bar (addButtonToControlBar) and determine its position using buttonPositionIndex. This change improves the modularity and customization of the player

 window.initPlayer('my-video', {
 airplayPlugin: {
 addButtonToControlBar: boolean,
 buttonPositionIndex: 16,
 }
 })

Hotspots

In KWIKplayer v9, the options structure for Hotspots module undergone minor changes. The options such as size, radius, left, top, width, and height have been updated to accept number values instead of string.

Before update

 window.initPlayer('my-video', {
 hotspots: [{...}]
 })

After update

 window.initPlayer('my-video', {
 hotspotsPlugin: [{...}]
 })

Hotspots editor

In KWIKplayer v9, the options structure for the Hotspots Editor plugin has been updated with the addition of Plugin at the end of its name, becoming hotspotsEditorPlugin.

Before update

 window.initPlayer('my-video', {
 hotspotEditor: {
 valuehandler: string | ((hotspots) => void),
 controls: ['hotspot' | 'image' | 'text'],
 }
 })

After update

 window.initPlayer('my-video', {
 hotspotsEditorPlugin: {
 valuehandler: string | ((hotspots: ModuleHotspotsEditor.Options[]) => void),
 controls: ['hotspot' | 'image' | 'text'],
 }
 })

Custom button

In KWIKplayer v9, the ccbutton configuration has been streamlined. The redundant css and style options have been removed. The new enabled boolean option is used to control whether the button is visible or hidden. The controlText option has been added to specify the text displayed when hovering over the button.

Before update

 window.initPlayer('my-video', {
 ccbutton: {
 enabled: boolean,
 css: string,
 className: string,
 style: string,
 eventName: string,
 menuItems: [],
 }
 })

After update

 window.initPlayer('my-video', {
 ccbutton: {
 enabled: boolean,
 className: string,
 controlText: string,
 eventName: string,
 menuItems: [],
 },
 })

Google analytics

In KWIKplayer v9, the Google Analytics configuration has been updated to use the googleAnalyticsPlugin instead of ga. The new structure introduces an assetName option to specify the asset being tracked. The events array now includes more detailed information, allowing you to define the name, label, action, and enabled status for each event.

Before update

 window.initPlayer('my-video', {
 ga: {
 mode: 'GTAG',
 events: ['ended'],
 debug: boolean,
 },
 })

After update

 window.initPlayer('my-video', {
 googleAnalyticsPlugin: {
 mode: 'GTAG',
 assetName: string,
 events: [{
 name: 'ended',
 label: string,
 action: 'ended',
 enabled: boolean,
 }],
 debug: boolean,
 },
 })

Kwik analytics

In KWIKplayer v9, the kwikAnalyticsPlugin has replaced the stat configuration. The plugin now includes a new category option to specify the category of the analytics data, as well as a siteId option to differentiate between various platforms (such as js, lbci android, or lbci ios). The other options, such as url, events, title, interval, mediaId, and userId, remain the same, providing continuity in tracking analytics data.

Before update

 window.initPlayer('my-video', {
 stat: {
 url: string,
 events: string[],
 title: string,
 interval: 5,
 },
 mediaid: string,
 userid: string,
 })

After update

 window.initPlayer('my-video', {
 kwikAnalyticsPlugin: {
 url: string,
 events: string[],
 title: string,
 interval: 5,
 category: string,
 mediaId: string,
 userId: string,
 siteId: '0' | '1' | '2', // 0 - js, 1 - lbci android, 2 - lbci ios
 }
 })

Npaw analytics

In KWIKplayer v9, the npaw configuration is now npawAnalyticsPlugin. The plugin now uses more concise naming for custom dimensions and other content properties. The mediaid and userid options have been removed, and custom dimensions are now handled with content.customDimension.1 and content.customDimension.2. The rest of the options for tracking content-related data remain largely the same.

Before update

 window.initPlayer('my-video', {
 npaw: {
 debug: boolean,
 options: {
 'content.channel': string,
 'content.customDimensions': {
 monetization: string
 },
 'content.episodeTitle': string,
 'content.genre': string,
 'content.id': string,
 'content.season': string,
 'content.title': string,
 'content.tvShow': string,
 'content.type': string,
 'content.contractedResolution': string,
 'content.cost': string,
 'content.price': string,
 'user.name': 0,
 },
 mediaid: 'development',
 userid: 0,
 },
 })

After update

 window.initPlayer('my-video', {
 npawAnalyticsPlugin: {
 debug: boolean,
 'content.channel': string,
 'content.contractedResolution': string,
 'content.cost': string,
 'content.customDimension.1': string,
 'content.customDimension.2': string,
 'content.episodeTitle': string,
 'content.genre': string,
 'content.id': string,
 'content.price': string,
 'content.season': string,
 'content.title': string,
 'content.tvShow': string,
 'content.type': string,
 'user.name': '0',
 }
 })

IMA

In KWIKplayer v9, the advertising module is now imaPlugin. The admessage has been replaced by adLabel and adLabelNofN. The schedule structure has been updated to adsSchedule with more specific controls for preroll, midroll, and postroll. Additionally, new options such as autoPlayAdBreaks, disableAdControls, and featureFlags have been introduced for more granular control over ads.

Before update

 window.initPlayer('my-video', {
 advertising: {
 debug: boolean,
 contribAdsSettings: {...},
 omniMode: {...},
 omidVendorAccess: {...}
 admessage: string,
 vpaidMode: 'ENABLED',
 schedule: {
 [string]: {
 offset: string,
 tag: string,
 }
 }
 }
 })

After update

 window.initPlayer('my-video', {
 imaPlugin: {
 debug: boolean,
 contribAdsSettings: {...},
 omidVendorAccess: {...},
 vpaidMode: 'ENABLED',
 adLabel: string,
 adLabelNofN: string,
 adTagUrl: string,
 adsRenderingSettings: {...},
 adsResponse: string,
 adsSchedule: {
 preroll: string[],
 [midroll: number]: string[],
 postroll: string[],
 },
 adsRequest: {...}
 autoPlayAdBreaks: boolean,
 disableAdControls: boolean,
 disableCustomPlaybackForIOS10Plus: boolean,
 disableFlashAds: boolean,
 featureFlags: {...}
 forceNonLinearFullSlot: boolean,
 locale: string,
 nonLinearHeight: 0,
 nonLinearWidth: 0,
 numRedirects: 0,
 ppid: string,
 preventLateAdStart: boolean,
 sessionId: string,
 showControlsForJSAds: boolean,
 showCountdown: boolean,
 vastLoadTimeout: 0,
 }
 })

IMA DAI

In KWIKplayer v9, the imadai module is now imaDaiPlugin. The options have been expanded with more detailed settings like assetKey, streamFormat, adTagParameters, and authToken. The live option is replaced by isLiveStream, and the backupStream becomes fallbackStreamUrl. New options for stream monitoring and localization have also been added.

Before update

 window.initPlayer('my-video', {
 imadai: {
 live: boolean,
 mode: string,
 backupStream: string,
 apiKey: string,
 cmsId: string,
 videoId: string,
 urlJump: boolean,
 },
 videoId: string,
 })

After update

 window.initPlayer('my-video', {
 imaDaiPlugin: {
 isLiveStream: boolean,
 fallbackStreamUrl: string,
 apiKey: string,
 cmsId: string,
 videoId: string,
 assetKey: string,
 streamFormat: string,
 adTagParameters: {
 someParameter: string,
 },
 authToken: string,
 bookmarkTime: string,
 locale: string,
 streamActivityMonitorId: string,
 }
 })

Soap

Before update

 window.initPlayer('my-video', {
 series: string,
 })

After update

 window.initPlayer('my-video', {
 soapButton: {
 xml: string,
 }
 })

Resume

In KWIKplayer v9, the resume option for *Resume component has been replaced by the resumeModal setting. This simplifies the configuration by directly enabling or disabling the resume modal functionality.

Before update

 window.initPlayer('my-video', {
 mediaid: string,
 resume: boolean,
 })

After update

 window.initPlayer('my-video', {
 resumeModal: boolean
 })

Event changes

In KWIKplayer v9, several events have been renamed (e.g., playlistsorted is now playlist:changed), and new event types such as share:opened have been added. If you rely on specific event listeners, reviewing these changes is strongly recommended.

Tip: Use this.player.on('*', (event) => console.log(event)) to monitor all triggered custom events.

📞

Contact & Support

White Peaks Solutions SAS