@kkcompany/ott-player 0.5.0-canary.28 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [0.5.0-canary.28](https://gitlab.kkinternal.com/kks-web/blahaj/compare/v0.3.93...v0.5.0-canary.28) (2026-03-12)
5
+ ## [0.5.0](https://gitlab.kkinternal.com/kks-web/blahaj/compare/player@0.3.97...player@0.5.0) (2026-05-08)
6
6
 
7
7
 
8
8
  ### Features
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. See [standa
12
12
  * add hidden toggle component ([fde7230](https://gitlab.kkinternal.com/kks-web/blahaj/commit/fde72307fda4d6c840f9b768aaf1cd406bae1f3e))
13
13
  * add line clamp to video item title ([3808a9a](https://gitlab.kkinternal.com/kks-web/blahaj/commit/3808a9afb451e96cbe1ceafc5fa9282390a6f0f4))
14
14
  * add support for new source type / subdub menu ([8d328f4](https://gitlab.kkinternal.com/kks-web/blahaj/commit/8d328f44fa44803deafed96810e02ee44fb04dad))
15
+ * add support for playready sl3000 ([bcd61ef](https://gitlab.kkinternal.com/kks-web/blahaj/commit/bcd61eff45e7991188e6685f2be4fa3a60d05cff))
15
16
  * add VideoItem progress ([4abcbe0](https://gitlab.kkinternal.com/kks-web/blahaj/commit/4abcbe0f877787c95703e196c975deb451438901))
16
17
  * add VideoItem, VideoThumbnail ([81357c4](https://gitlab.kkinternal.com/kks-web/blahaj/commit/81357c4dcd2665b5057aa2d4aac15534e0564023))
17
18
  * **app-ui:** add secondary text to video item ([b834134](https://gitlab.kkinternal.com/kks-web/blahaj/commit/b83413495943cc4ae5f7b98f5c65852fedfd7425))
@@ -46,7 +47,6 @@ All notable changes to this project will be documented in this file. See [standa
46
47
  * line clamp can't work with padding ([15e5f3b](https://gitlab.kkinternal.com/kks-web/blahaj/commit/15e5f3b6637c76f68891e67298791ed601c262fa))
47
48
  * move Dropdown from kks-react-components ([558ae40](https://gitlab.kkinternal.com/kks-web/blahaj/commit/558ae404d07b70066e91c5934fc19f82646fcef3))
48
49
  * path of certificateUri ([79cb50f](https://gitlab.kkinternal.com/kks-web/blahaj/commit/79cb50fd664b4a17227d0c0b9d787e698dd725bd))
49
- * prefer PlayReady only on Windows Edge ([4b9ad41](https://gitlab.kkinternal.com/kks-web/blahaj/commit/4b9ad4101611f8bfd15a2056828633e7651daf09))
50
50
  * release version 0.3.99 ([105f05b](https://gitlab.kkinternal.com/kks-web/blahaj/commit/105f05ba26ef46ff6b6049922f89a515fa7a874e))
51
51
  * should not reset after session end ([1f8bad5](https://gitlab.kkinternal.com/kks-web/blahaj/commit/1f8bad5b79533aa01182d3b75d7132578ede9e7a))
52
52
  * should not reset log instance of new session ([f109bd9](https://gitlab.kkinternal.com/kks-web/blahaj/commit/f109bd911af63c6aac545f4adc5658e4e56c39b3))
package/dist/index.cjs CHANGED
@@ -857,25 +857,9 @@ const startPlaybackSession = async (playbackApi, options = {}) => {
857
857
  };
858
858
  var startSession_default = startPlaybackSession;
859
859
 
860
- //#endregion
861
- //#region src/browserCompatibility.js
862
- const isWindowsEdge = () => typeof navigator !== "undefined" && /Windows/.test(navigator.userAgent) && /Edg/.test(navigator.userAgent);
863
- const getPreferredKeySystems = () => isWindowsEdge() ? ["com.microsoft.playready"] : ["com.apple.fps.1_0", "com.widevine.alpha"];
864
- const getDefaultDrmOptions = ({ manifestType, licenseUri, certificateUri = `${licenseUri}/fairplay_cert`, headers }) => {
865
- const keySystemForDash = isWindowsEdge() ? "playready" : "widevine";
866
- return /hls/i.test(manifestType) ? { fairplay: {
867
- licenseUri,
868
- certificateUri,
869
- headers
870
- } } : { [keySystemForDash]: {
871
- licenseUri,
872
- headers
873
- } };
874
- };
875
-
876
860
  //#endregion
877
861
  //#region src/playbackSession/api.js
878
- const getStreamInfo = (sources = [], { type: type$1 = "", licenseUri, certificateUri = licenseUri && new URL(`fairplay_cert`, licenseUri).toString(), licenseHeaders: headers, thumbnailEnabled, getDrmOptions = getDefaultDrmOptions, getTextTrackInfo } = {}) => {
862
+ const getStreamInfo = (sources = [], { type: type$1 = "", licenseUri, certificateUri = licenseUri && new URL(`fairplay_cert`, licenseUri).toString(), licenseHeaders: headers, thumbnailEnabled, getDrmOptions, getTextTrackInfo } = {}) => {
879
863
  const activeSource = sources.find((source) => (source.subdub || source.type || "").toLowerCase() === type$1) || sources[0];
880
864
  return (activeSource?.manifests || []).map((manifest) => ({
881
865
  ...manifest,
@@ -930,12 +914,28 @@ var preload_default = preload;
930
914
 
931
915
  //#endregion
932
916
  //#region package.json
933
- var version = "0.5.0-canary.28";
917
+ var version = "0.5.0";
934
918
 
935
919
  //#endregion
936
920
  //#region src/constants.js
937
921
  const PLAYER_VERSION = version;
938
922
 
923
+ //#endregion
924
+ //#region src/browserCompatibility.js
925
+ const isWindowsEdge = () => typeof navigator !== "undefined" && /Windows/.test(navigator.userAgent) && /Edg/.test(navigator.userAgent);
926
+ const getPreferredKeySystems = () => isWindowsEdge() ? ["com.microsoft.playready"] : ["com.apple.fps.1_0", "com.widevine.alpha"];
927
+ const getDefaultDrmOptions = ({ manifestType, licenseUri, certificateUri = `${licenseUri}/fairplay_cert`, headers, playready }) => {
928
+ const keySystemForDash = isWindowsEdge() ? playready === "sl3000" ? "com.microsoft.playready.recommendation.3000" : "playready" : "widevine";
929
+ return /hls/i.test(manifestType) ? { fairplay: {
930
+ licenseUri,
931
+ certificateUri,
932
+ headers
933
+ } } : { [keySystemForDash]: {
934
+ licenseUri,
935
+ headers
936
+ } };
937
+ };
938
+
939
939
  //#endregion
940
940
  //#region src/PremiumPlusPlayer.jsx
941
941
  const padTime = (value) => Math.floor(value).toString().padStart(2, "0");
@@ -959,7 +959,7 @@ const getEnterpriseDrmHeaders = ({ token, tokenType = "playback" }) => {
959
959
  };
960
960
  const sessionCache = {};
961
961
  const getCastState = () => window.cast?.framework?.CastContext.getInstance()?.getCastState() || CastState.NO_DEVICES_AVAILABLE;
962
- const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList = [], currentTime, quality, sourceType, host, accessToken, deviceId, headers, params, contentType, contentId, contentKey = `${contentType}/${contentId}`, autoplayNext, thumbnailSeeking, plugins = [], settings: appSettings = {}, coverImageUrl, coverImageDisplay = "auto", recommendation, uiElements: { castButton, ...uiElements } = {}, playerRef, children, slotProps, onError, onApiError, onBack, onPlaybackStateChange, onPlayerLoaded, onChange, onPlaybackApiResponse, sendLog, playbackState: appPlaybackState, turnOnSkipOpening, shouldHideSkipButton = false, playerToModuleErrorCodeMap, drmTokenType, ...rest }) => {
962
+ const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList = [], currentTime, quality, sourceType, host, accessToken, deviceId, headers, params, contentType, contentId, contentKey = `${contentType}/${contentId}`, autoplayNext, thumbnailSeeking, plugins = [], settings: appSettings = {}, coverImageUrl, coverImageDisplay = "auto", recommendation, uiElements: { castButton, ...uiElements } = {}, playerRef, children, slotProps, onError, onApiError, onBack, onPlaybackStateChange, onPlayerLoaded, onChange, onPlaybackApiResponse, sendLog, playbackState: appPlaybackState, turnOnSkipOpening, shouldHideSkipButton = false, playerToModuleErrorCodeMap, drmOptions = {}, ...rest }) => {
963
963
  const videoRef = (0, react.useRef)();
964
964
  const corePlayerRef = (0, react.useRef)();
965
965
  const lastSession$1 = (0, react.useRef)({});
@@ -1118,11 +1118,12 @@ const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList
1118
1118
  type: sourceType,
1119
1119
  getTextTrackInfo: appSettings.getTextTrackInfo,
1120
1120
  licenseUri: playbackInfo.drmPortalUrl,
1121
- licenseHeaders: getEnterpriseDrmHeaders({
1122
- token: playbackInfo.token,
1123
- tokenType: drmTokenType
1124
- }),
1125
- thumbnailEnabled: thumbnailSeeking
1121
+ licenseHeaders: getEnterpriseDrmHeaders({ token: playbackInfo.token }),
1122
+ thumbnailEnabled: thumbnailSeeking,
1123
+ getDrmOptions: (options) => getDefaultDrmOptions({
1124
+ ...drmOptions,
1125
+ ...options
1126
+ })
1126
1127
  }), playbackState === "emptied" ? contentData.startTime + 1 / 30 : videoRef.current?.currentTime], [
1127
1128
  playbackInfo,
1128
1129
  contentData.end,
@@ -1151,7 +1152,7 @@ const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList
1151
1152
  });
1152
1153
  }, []);
1153
1154
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__kkcompany_player_react.PremiumPlayer, {
1154
- shaka: { drm: { preferredKeySystems: getPreferredKeySystems() } },
1155
+ shaka: drmOptions.playready === "sl3000" ? {} : { drm: { preferredKeySystems: getPreferredKeySystems() } },
1155
1156
  source: playbackState !== "error" && source,
1156
1157
  currentTime: preferAppTime.current ? currentTime : startTime,
1157
1158
  controls: uiState.activePanel === "autoplay-next" || uiState.activePanel === "recommendation" && recommendation ? "title-only" : controls,
package/dist/index.mjs CHANGED
@@ -833,25 +833,9 @@ const startPlaybackSession = async (playbackApi, options = {}) => {
833
833
  };
834
834
  var startSession_default = startPlaybackSession;
835
835
 
836
- //#endregion
837
- //#region src/browserCompatibility.js
838
- const isWindowsEdge = () => typeof navigator !== "undefined" && /Windows/.test(navigator.userAgent) && /Edg/.test(navigator.userAgent);
839
- const getPreferredKeySystems = () => isWindowsEdge() ? ["com.microsoft.playready"] : ["com.apple.fps.1_0", "com.widevine.alpha"];
840
- const getDefaultDrmOptions = ({ manifestType, licenseUri, certificateUri = `${licenseUri}/fairplay_cert`, headers }) => {
841
- const keySystemForDash = isWindowsEdge() ? "playready" : "widevine";
842
- return /hls/i.test(manifestType) ? { fairplay: {
843
- licenseUri,
844
- certificateUri,
845
- headers
846
- } } : { [keySystemForDash]: {
847
- licenseUri,
848
- headers
849
- } };
850
- };
851
-
852
836
  //#endregion
853
837
  //#region src/playbackSession/api.js
854
- const getStreamInfo = (sources = [], { type: type$1 = "", licenseUri, certificateUri = licenseUri && new URL(`fairplay_cert`, licenseUri).toString(), licenseHeaders: headers, thumbnailEnabled, getDrmOptions = getDefaultDrmOptions, getTextTrackInfo } = {}) => {
838
+ const getStreamInfo = (sources = [], { type: type$1 = "", licenseUri, certificateUri = licenseUri && new URL(`fairplay_cert`, licenseUri).toString(), licenseHeaders: headers, thumbnailEnabled, getDrmOptions, getTextTrackInfo } = {}) => {
855
839
  const activeSource = sources.find((source) => (source.subdub || source.type || "").toLowerCase() === type$1) || sources[0];
856
840
  return (activeSource?.manifests || []).map((manifest) => ({
857
841
  ...manifest,
@@ -906,12 +890,28 @@ var preload_default = preload;
906
890
 
907
891
  //#endregion
908
892
  //#region package.json
909
- var version = "0.5.0-canary.28";
893
+ var version = "0.5.0";
910
894
 
911
895
  //#endregion
912
896
  //#region src/constants.js
913
897
  const PLAYER_VERSION = version;
914
898
 
899
+ //#endregion
900
+ //#region src/browserCompatibility.js
901
+ const isWindowsEdge = () => typeof navigator !== "undefined" && /Windows/.test(navigator.userAgent) && /Edg/.test(navigator.userAgent);
902
+ const getPreferredKeySystems = () => isWindowsEdge() ? ["com.microsoft.playready"] : ["com.apple.fps.1_0", "com.widevine.alpha"];
903
+ const getDefaultDrmOptions = ({ manifestType, licenseUri, certificateUri = `${licenseUri}/fairplay_cert`, headers, playready }) => {
904
+ const keySystemForDash = isWindowsEdge() ? playready === "sl3000" ? "com.microsoft.playready.recommendation.3000" : "playready" : "widevine";
905
+ return /hls/i.test(manifestType) ? { fairplay: {
906
+ licenseUri,
907
+ certificateUri,
908
+ headers
909
+ } } : { [keySystemForDash]: {
910
+ licenseUri,
911
+ headers
912
+ } };
913
+ };
914
+
915
915
  //#endregion
916
916
  //#region src/PremiumPlusPlayer.jsx
917
917
  const padTime = (value) => Math.floor(value).toString().padStart(2, "0");
@@ -935,7 +935,7 @@ const getEnterpriseDrmHeaders = ({ token, tokenType = "playback" }) => {
935
935
  };
936
936
  const sessionCache = {};
937
937
  const getCastState = () => window.cast?.framework?.CastContext.getInstance()?.getCastState() || CastState.NO_DEVICES_AVAILABLE;
938
- const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList = [], currentTime, quality, sourceType, host, accessToken, deviceId, headers, params, contentType, contentId, contentKey = `${contentType}/${contentId}`, autoplayNext, thumbnailSeeking, plugins = [], settings: appSettings = {}, coverImageUrl, coverImageDisplay = "auto", recommendation, uiElements: { castButton, ...uiElements } = {}, playerRef, children, slotProps, onError, onApiError, onBack, onPlaybackStateChange, onPlayerLoaded, onChange, onPlaybackApiResponse, sendLog, playbackState: appPlaybackState, turnOnSkipOpening, shouldHideSkipButton = false, playerToModuleErrorCodeMap, drmTokenType, ...rest }) => {
938
+ const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList = [], currentTime, quality, sourceType, host, accessToken, deviceId, headers, params, contentType, contentId, contentKey = `${contentType}/${contentId}`, autoplayNext, thumbnailSeeking, plugins = [], settings: appSettings = {}, coverImageUrl, coverImageDisplay = "auto", recommendation, uiElements: { castButton, ...uiElements } = {}, playerRef, children, slotProps, onError, onApiError, onBack, onPlaybackStateChange, onPlayerLoaded, onChange, onPlaybackApiResponse, sendLog, playbackState: appPlaybackState, turnOnSkipOpening, shouldHideSkipButton = false, playerToModuleErrorCodeMap, drmOptions = {}, ...rest }) => {
939
939
  const videoRef = useRef();
940
940
  const corePlayerRef = useRef();
941
941
  const lastSession$1 = useRef({});
@@ -1094,11 +1094,12 @@ const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList
1094
1094
  type: sourceType,
1095
1095
  getTextTrackInfo: appSettings.getTextTrackInfo,
1096
1096
  licenseUri: playbackInfo.drmPortalUrl,
1097
- licenseHeaders: getEnterpriseDrmHeaders({
1098
- token: playbackInfo.token,
1099
- tokenType: drmTokenType
1100
- }),
1101
- thumbnailEnabled: thumbnailSeeking
1097
+ licenseHeaders: getEnterpriseDrmHeaders({ token: playbackInfo.token }),
1098
+ thumbnailEnabled: thumbnailSeeking,
1099
+ getDrmOptions: (options) => getDefaultDrmOptions({
1100
+ ...drmOptions,
1101
+ ...options
1102
+ })
1102
1103
  }), playbackState === "emptied" ? contentData.startTime + 1 / 30 : videoRef.current?.currentTime], [
1103
1104
  playbackInfo,
1104
1105
  contentData.end,
@@ -1127,7 +1128,7 @@ const PremiumPlusPlayer = ({ controls, preload: preload$1 = "auto", preloadList
1127
1128
  });
1128
1129
  }, []);
1129
1130
  return /* @__PURE__ */ jsxs(PremiumPlayer, {
1130
- shaka: { drm: { preferredKeySystems: getPreferredKeySystems() } },
1131
+ shaka: drmOptions.playready === "sl3000" ? {} : { drm: { preferredKeySystems: getPreferredKeySystems() } },
1131
1132
  source: playbackState !== "error" && source,
1132
1133
  currentTime: preferAppTime.current ? currentTime : startTime,
1133
1134
  controls: uiState.activePanel === "autoplay-next" || uiState.activePanel === "recommendation" && recommendation ? "title-only" : controls,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kkcompany/ott-player",
3
- "version": "0.5.0-canary.28",
3
+ "version": "0.5.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/index.mjs",
@@ -19,8 +19,7 @@
19
19
  "scripts": {
20
20
  "develop": "next",
21
21
  "start": "next start",
22
- "test": "jest --coverage",
23
- "watch:test": "jest --watch",
22
+ "test": "vitest",
24
23
  "build": "tsdown --format esm --format cjs --dts false",
25
24
  "release": "standard-version -a"
26
25
  },
@@ -41,6 +40,7 @@
41
40
  "@biomejs/biome": "^2.3.5",
42
41
  "standard-version": "^9.5.0",
43
42
  "tsdown": "^0.16.4",
44
- "typescript": "^5.8.3"
43
+ "typescript": "^5.8.3",
44
+ "vitest": "^4.1.0"
45
45
  }
46
46
  }