Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@playkit-js/playkit-js-providers

kaltura2.3kAGPL-3.02.43.0TypeScript support: included

Build Status [![code style: prettier](https://img.shie

readme

PlayKit JS Providers - Cloud TV and OVP Media Provider Plugins for the PlayKit JS Player

Build Status code style: prettier

The PlayKit JS Providers plugin helps integrate Kaltura OVP and Cloud TV backend data APIs with the PlayKit JS Player.

PlayKit JS Providers is written in ECMAScript6, analyzed statically using Flow, and transpiled in ECMAScript5 using Babel.

Table of Contents

Getting Started

Installing

First, clone and run yarn to install the required dependencies:

git clone https://github.com/kaltura/playkit-js-providers.git
cd playkit-js-providers
yarn install

Building

Next, build the player:

yarn run build

Embed the Library In Your Test Page

Finally, add the bundle as a script tag in your page, and initialize the provider:

OVP Provider

<script type="text/javascript" src="/PATH/TO/FILE/playkit-ovp-provider.js"></script>
<div id="player-placeholder" style="height:360px; width:640px">
  <script type="text/javascript">
    // Step 1 - Create a provider options object
    var options = {
      partnerId: "YOUR_PARTNER_ID", // Mandatory
      ks: "YOUR_KS", // Optional
      log:{
        level: "LOG_LEVEL", // Optional
      }
      uiConfId: UI_CONF_ID,  // Optional
      env: {  // Optional
        serviceUrl: "YOUR_SERVICE_URL",
        cdnUrl: "YOUR_CDN_URL"
      }
    };
    // Step 2 - Create a provider instance
    var provider = new playkit.providers.ovp.Provider(options);
    // Step 3 - Create media info object
    var mediaInfo = {
      entryId: "YOUR_ENTRY_ID" // Mandatory
      ks: "YOUR_KS" // Optional
    };
    // Step 4 - Get the media config
    provider.getMediaConfig(mediaInfo).then(function(mediaConfig) {
      // Manipulate media config
    });
  </script>
</div>

Cloud TV Provider

<script type="text/javascript" src="/PATH/TO/FILE/playkit-ott-provider.js"></script>
<div id="player-placeholder" style="height:360px; width:640px">
  <script type="text/javascript">
    // Step 1 - Create a provider options object
    var options = {
      partnerId: "YOUR_PARTNER_ID", // Mandatory
      ks: "YOUR_KS", // Optional
      log:{
       level:"LOG_LEVEL", // Optional
      }
      uiConfId: UI_CONF_ID,  // Optional
      env: {  // Optional
        serviceUrl: "YOUR_SERVICE_URL",
        cdnUrl: "YOUR_CDN_URL"
      }
    };
    // Step 2 - Create a provider instance
    var provider = new playkit.providers.ott.Provider(options);
    // Step 3 - Create media info object
    var mediaInfo = {
      entryId: "YOUR_ENTRY_ID", // Mandatory
      ks: "YOUR_KS", // Optional,
      mediaType: "YOUR_MEDIA_TYPE" // Optional, default: "MEDIA"
      contextType: "YOUR_MEDIA_CONTEXT_TYPE", // Optional, default: "PLAYBACK"
      protocol: "YOUR_PROTOCOL", // Optional
      fileIds: "YOUR_FILE_IDS" // Optional
    };
    // Step 4 - Get the media config
    provider.getMediaConfig(mediaInfo).then(function(mediaConfig) {
      // Manipulate media config
    });
  </script>
</div>

Documentation

Running the Tests

You can run tests locally via Karma, which will run on Chrome, Firefox and Safari browsers.

yarn run test

You can also test individual browsers in the following way:

yarn run test:chrome
yarn run test:firefox
yarn run test:safari

Coding Style Tests

Kaltura uses ESLint recommended set with some additions for enforcing Flow types and other rules.

See ESLint config for the full configuration.

We also use .editorconfig to maintain consistent coding styles and settings; please make sure you comply with these styles.

Compatibility

TBD

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the available versions, see the tags on this repository.

Licensing

This project is licensed under the AGPL-3.0 License - see the LICENSE.md file for details

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.43.0 (2025-05-22)

Features

  • FEC-14439: Add link to original entry when playing a clip entry (#264) (cd2217f)

2.42.0 (2025-03-20)

Features

  • FEC-14415: add path to initial call to kaltura server (#262) (07d09a7)

2.41.4 (2025-02-20)

Bug Fixes

  • FEC-14248: Anonymous session based on if ks contain user - fix (#261) (d258629)

2.41.3 (2025-02-07)

Bug Fixes

  • SUP-46065: Player shows VR button based on "360" (or variations) tag (#257) (31ef303)

2.41.2 (2025-01-23)

2.41.1 (2025-01-09)

Bug Fixes

2.41.0 (2024-11-14)

Features

2.40.8 (2024-08-22)

Bug Fixes

  • FEC-14071: thumbnail requests append height, width, ks too many times (#243) (932a336)

2.40.7 (2024-08-03)

Bug Fixes

  • FEC-14049: Send referrer only if it came from iFrame embed (#242) (46c81fb)

2.40.6 (2024-05-19)

2.40.5 (2024-04-09)

Bug Fixes

2.40.4 (2024-02-25)

Bug Fixes

  • FEC-13671: Export 5 dedicated TS declaration files for each bundle (#236) (b3e5269)

2.40.3 (2024-02-04)

2.40.2 (2024-01-07)

Bug Fixes

2.40.1 (2023-12-21)

Bug Fixes

  • FEC-13566: remove documents from playlist (#227) (f2a1cb3)

2.40.0 (2023-11-26)

Features

  • FEC-13450: resume playlist from last entry (#226) (c6ec6c0)

2.39.6 (2023-10-31)

Bug Fixes

  • FEC-13143: add last update and ownerId to media metadata (#224) (716749e)

2.39.5 (2023-07-26)

Bug Fixes

  • FEC-13134: add views and plays counts to media entry metadata if available (#220) (9ee39ec)

2.39.4 (2023-06-07)

Bug Fixes

  • FEC-13134: add ceratedAt and endedDate to media entry metadata if available (#216) (28f6822)

2.39.3 (2023-05-17)

Bug Fixes

  • FEC-13123: replace travis with github actions (#210) (edd6027)

2.39.2 (2023-05-08)

2.39.1 (2023-05-08)

Bug Fixes

  • FEC-13123: replace travis with github actions (#208) (0ca0f3c)

2.39.0 (2023-02-22)

Bug Fixes

  • FEC-12929: Add an image preview on "next-screen" in image item on playlist (#202) (c6b1c99)

Features

  • FEC-12850: ECDN Fallback Option Upon Inaccessible API Gateway (#201) (fbcf62b)

2.38.0 (2023-01-26)

Features

2.37.0 (2022-11-02)

Features

  • FEC-12625: add entry id to media metadata (#184) (6355806)

2.36.1 (2022-10-03)

Bug Fixes

  • FEC-12588: 360 player loads whenever you have a tag that contains 360 (ie. wells360fargo) (#183) (2670c2a)

2.36.0 (2022-08-04)

Features

  • FEC-12414: add contextType to mediaEntry Metadata & upgrade API version 7.8.1 (#182) (9734376)

2.35.1 (2022-06-09)

Bug Fixes

  • FEC-12243: simulive - The live stream will show the captions from the Simulive entry (#178) (8339e96)

2.35.0 (2022-05-12)

Bug Fixes

  • FEC-11882: V3- Playlist/Related plugin - if entries list includes broken entry ID, the list doesn't load at all (#175) (97bc9dc)
  • FEC-12084: OVP Provider doesn't play entries of partner 0 (#174) (c736951)
  • FEC-12166: canary not working-error 1006 (#176) (15a81b4)

Features

  • FEC-12229: append KS to thumbnail API (#177) (9db2419)

2.34.0 (2022-03-23)

Features

2.33.0 (2022-02-16)

Bug Fixes

  • FEV-1164: export ServiceResult as part of ResponseTypes (#165) (7444a2b)

Features

2.32.0 (2021-12-21)

Features

  • FEC-11608: Provider - Expose default service Url (#157) (42c5cd9)
  • FEC-11696: add ks paramater in doRequest (#159) (4f0f245)

Tests

2.31.0 (2021-11-10)

Features

2.30.0 (2021-08-26)

Build System

  • FEC-11389: reduce builds from travis (4f06110)

Features

2.29.1 (2021-07-01)

Bug Fixes

  • FEC-11363: OTT player doesn't get error for invalid KS (#150) (e565490)

2.29.0 (2021-06-14)

Features

2.28.1 (2021-03-24)

Bug Fixes

  • FEC-11104: Crash on IE11 URL doesn't exist (#139) (81c81a3)

2.28.0 (2021-01-28)

Bug Fixes

  • FEC-10699: objectType KalturaLiveAsset should check enableTrickPlay even if externalIds > 0 (#137) (66c15f3)
  • FEC-10722: add KS to external captions (#134) (c25096f)

Features

  • FEC-10699: add Linear media type recognition by OTT BE response (#136) (23a3f99)

2.27.0 (2021-01-07)

Bug Fixes

  • FEC-10636: Add KS to playbackUrl for direct playbackContext url (#131) (aaa4484)
  • FEC-10779: add the all JSLogger for stubbing (#129) (09ddef6)

Features

  • FEC-10804: add adapterData to getPlayback context request (#132) (f4c9ebb)

2.26.0 (2020-12-07)

Bug Fixes

  • FEC-10698: multi-request return entryId instead of sources, no playback (#127) (9e634f1)
  • FEC-10722: ks missing for external captions (#128) (7400262)

Features

  • FEC-10387: add support for referenceId filter in provider (#126) (738e8a9)

2.25.0 (2020-11-22)

Features

  • FEC-9142: getting bumper from providers by entry id (OVP) (#88) (907d0ea)

2.24.0 (2020-11-03)

Build System

  • remove plugins that already exist on preset-env (#123) (d750150)

Features

  • FEC-10615: support sending Kava beacons as POST (0b317fd)
  • FEC-10615: support sending Kava beacons as POST (#125) (7fe3284)

2.23.0 (2020-10-14)

Features

  • FEC-9197: add streamerType and urlType into the getPlaybackContext (#124) (6a82d05)

2.22.2 (2020-10-06)

Bug Fixes

  • FEC-10524: stub logger and get logger from Kaltura player (#119) (1d32a94)

Build System

  • add commit after the build process. (#121) (d2d81ba)
  • create canary build on changes on master branch (#120) (821edb3)
  • missing yarn in commit command (#122) (01a0d1e)
  • FEC-10064: add automatic release notes (#118) (e6ed497)

2.22.1 (2020-09-02)

Bug Fixes

  • FEC-10161: add kava anayltics url from server response (#117) (f059217)
  • FEC-10394: Empty metadata xml field throws provider error (#115) (abb3317)

Tests

2.22.0 (2020-08-05)

Bug Fixes

  • add defaults to request builder (#114) (9ddacb1)
  • FEC-10023: use serviceUrl instead of cdnUrl to create playback urls in V7 (#108) (0fd9f8f)
  • widget id as anonymous (#105) (c813e4b)

Features

  • FEC-10290: upgrade NPM packages (#112) (45c4038)
  • FEC-8872: add provider check for entry status import and converting (#107) (04d677f)

2.21.1 (2020-05-10)

Bug Fixes

  • FEC-10023: use serviceUrl instead of cdnUrl to create playback urls in V7 (#108) (0fd9f8f)

2.21.0 (2020-04-13)

Features

  • FEC-8872: add provider check for entry status import and converting (#107) (04d677f)

2.20.6 (2020-01-29)

2.20.5 (2019-11-12)

Bug Fixes

2.20.4 (2019-11-03)

Bug Fixes

  • FEC-9467: progressive sources are not filtered correctly. (#96) (d0e815f)

2.20.3 (2019-10-31)

Bug Fixes

  • FEC-9304: OTT provider doesn't implement getPlaylistConfig api (#97) (02bf2c7)
  • FEC-9354: change apiVersion and fix asset type (#98) (28261ee)

2.20.2 (2019-08-26)

Bug Fixes

  • FEC-9268: new enum for AssetReferenceType (#94) (eaf470b)
  • FEC-9270: add report for media type in OTT (#93) (bec6ebc)

2.20.1 (2019-08-19)

Bug Fixes

  • FEC-9270: add report for media type in OTT (#93) (bec6ebc)

2.20.0 (2019-07-28)

Bug Fixes

  • FEC-9212: support redirectFromEntryId logic (#92) (810685b)

Features

  • FEC-9156: getting bumper from playback context (#91) (de7c668)

2.19.0 (2019-06-20)

Features

2.18.1 (2019-03-14)

Bug Fixes

  • FEC-8978: multiple players doing multi requests simultaneously may fail (#86) (b7376ce)

2.18.0 (2019-03-11)

Features

  • FEC-8974: add async config option for XHR (#85) (1b3545c)

2.17.2 (2019-02-27)

Bug Fixes

  • FEC-8935: Unable to play remote flavors (#84) (7624e8b)

2.17.1 (2019-02-27)

Bug Fixes

  • FEC-8725: player stuck in loading state with deleted entries (#80) (677f36f)

2.17.0 (2019-02-04)

Bug Fixes

  • FEC-8858: the captions in languages list displayed twice (#79) (553df9a)

Features

  • FEC-8875: when an external caption format is DFXP return the webvtt url (#81) (49581ad)

2.16.1 (2019-01-31)

Bug Fixes

  • FEC-8858: the captions in languages list displayed twice (#79) (553df9a)

2.16.0 (2019-01-24)

Features

  • FEC-8816: support the new captions API structure in getPlaybackContext (#78) (15db3de)

2.15.1 (2019-01-21)

2.15.0 (2019-01-20)

Features

  • FEC-8746: add wid parameter with the OVP provider (#75) (05028e7)
  • support external media sources for Youtube (#76) (443acab)

2.14.0 (2018-12-24)

Features

  • FEC-8766: add closed captions from multi request to external #74 (c10a5c9)

2.13.0 (2018-12-16)

Features

  • FEC-8705: playlist - OTT support (#73) (a15c53c)

2.12.0 (2018-12-12)

Features

  • FEC-8734: add protection for invalid source creation (#70) (8fd30fd)

2.11.0 (2018-12-04)

Bug Fixes

  • FEC-8739: block action is not fired from OTT provider (#71) (2a318db)

Features

  • FEC-8730: add kaltura regex action support to providers (#72) (bb3a9da)

2.10.1 (2018-11-19)

Bug Fixes

  • FEC-8679: isAnonymous is set incorrectly (#68) (c843f73)
  • 'networkRetryParameters' type causes KalturaPlayerJS build (flow) to fail #69 (6c67907)

2.10.0 (2018-11-18)

Bug Fixes

  • FEC-8660: handle API block action (#67) (78b3f22)

Features

  • FEC-8601: Add network requests retry mechanism and headers data to the error (#66) (695f68a)

2.9.0 (2018-11-07)

Features

  • FEC-8541: add redirectFromEntryId configuration (4757831)

2.8.0 (2018-10-28)

Features

2.7.3 (2018-10-14)

Bug Fixes

  • FEC-8555: phoenix provider live detection (#64) (c857176)

2.7.2 (2018-08-22)

Bug Fixes

  • FEC-8499: OTT - entry not recognized as 360 (#62) (7b6a7da)

2.7.1 (2018-07-02)

Bug Fixes

  • FEC-8341: support audio progressive entries (#59) (e91c42f)

2.7.0 (2018-06-21)

Features

  • FEC-8331: expose the anonymous flag on session object (#58) (245b760)

2.6.0 (2018-06-20)

Features

2.5.0 (2018-06-17)

Features

  • FEC-8316: protect against invalid server response (#57) (de5d5e3)

2.4.0 (2018-06-11)

Bug Fixes

  • add "/api_v3" to default service URL (#56) (eec7e33)

Features

2.3.2 (2018-05-26)

Bug Fixes

  • FEC-8235: remove default service url from OTT provider and analytics (#54) (43fb839)

2.3.1 (2018-05-16)

Bug Fixes

  • FEC-8217: add asset reference for the asset get service (#53) (fe7ae71)

2.3.0 (2018-05-06)

Bug Fixes

Features

  • FEC-8176: restructure media config (#52) (911d79d)

2.2.0 (2018-03-12)

Features

  • ott-provider: retrieve poster from ott backend (#43) (bdd5da1)

2.1.2 (2018-02-14)

Bug Fixes

  • FEC-7828: Live videos in OTT show VOD UI (#49) (d19c46a)

2.1.1 (2018-02-11)

Bug Fixes

  • FEC-7874: accessing undefined 'sources' property on bad request (#47) (e02a5a4)

2.1.0 (2018-01-21)

Bug Fixes

  • ott-provider: return media type (live/vod) (7daeed1)

Features

  • ott-provider: filter sources by device formats (#45) (c505537)

2.0.0 (2018-01-10)

Bug Fixes

Features

BREAKING CHANGES

API has been changed.

  • Provider constructor now gets (providerOptions: ProviderOptionsObject, playerVersion: string) when ProviderOptionsObject defined as:
    {
    partnerId: number,
    logLevel?: string,
    ks?: string,
    uiConfId?: number,
    env?: ProviderEnvConfigObject
    };
  • Change config API from getConfig() to getMediaConfig()
  • getMediaConfig API now gets (mediaInfo: ProviderMediaInfoObject) when ProviderMediaInfoObject defined as:

OVP media info

{
  entryId: string,
  ks?: string
};

OTT media info

{
  entryId: string,
  ks?: string,
  mediaType: string,
  contextType: string,
  protocol?: string,
  fileIds?: string
};

1.5.0 (2017-12-12)

Features

  • align environment parmas names (#38) (78f5a64)
  • change ovp provider constructor & getConfig signature (#32) (cab5932)

1.4.1 (2017-11-22)

1.4.0 (2017-11-16)

Features

1.3.2 (2017-11-07)

Bug Fixes

  • FEC-7389: player is not playing over https (#33) (8e436e3)

1.3.1 (2017-09-26)

Bug Fixes

  • FEC-7123: remove clientTag from default config and get it as param (#30) (3a080e2)
  • FEC-7186: support external/universal live entries (#29) (b4f143e)

1.3.0 (2017-09-06)

Features

1.2.0 (2017-08-31)

Bug Fixes

Features

1.1.1 (2017-08-23)

Bug Fixes

  • FEC-6841: change getters called 'name' to 'id' (#24) (e2f9b8b)

1.1.0 (2017-08-08)

Features

  • add poster and description data from api (#20) (3086c80)

1.0.0 (2017-07-30)

Bug Fixes

  • debugger: remove debugger (#5) (17b593a)
  • remove enumify package (#16) (0dd9231)
  • ovp-provider: build progressive urls correctly (#15) (a414f8d)
  • ovp-provider: do not send anonymous ks on playmanifest (#18) (9ab85b7)
  • ovpprovider: refactor media source src property (#6) (130f692)

Features

  • ovp-provider: implement ovp provider (#1) (f9744c6)