@kkcompany/player 2.25.0-canary.0 → 2.25.0-canary.2

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,27 +2,34 @@
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
- ## [2.25.0-canary.0](https://gitlab.kkinternal.com/playback/web-playcraft/compare/v2.9.20...v2.25.0-canary.0) (2025-10-08)
5
+ ## [2.25.0-canary.2](https://gitlab.kkinternal.com/playback/web-playcraft/compare/v2.25.0-canary.1...v2.25.0-canary.2) (2025-11-21)
6
6
 
7
7
 
8
8
  ### Features
9
9
 
10
- * add castMedia export with error handling added ([82aa0b6](https://gitlab.kkinternal.com/playback/web-playcraft/commit/82aa0b608aad2f2e5c638b20ca3254298ec77291))
11
10
  * add change setting support to new audio/subtitle menu ([97728db](https://gitlab.kkinternal.com/playback/web-playcraft/commit/97728dbdc5f223cfccc18818cb5afa3b17be36d3))
12
- * basic HLS on MSE ([b02c6f0](https://gitlab.kkinternal.com/playback/web-playcraft/commit/b02c6f0f44a89000aed9f279c1715bb4d0d115dc))
11
+ * custom language menu item order ([6bba6dc](https://gitlab.kkinternal.com/playback/web-playcraft/commit/6bba6dc3c137c292eb890ebefcdc49cf1d155d21))
13
12
  * display audio / subtitle options even if there's only 1 ([2e23915](https://gitlab.kkinternal.com/playback/web-playcraft/commit/2e23915d7aa7d084b65c9729c8ac468690852eb3))
14
13
  * enable custom language menu ([fb2038d](https://gitlab.kkinternal.com/playback/web-playcraft/commit/fb2038da7fc3ea399bad3fbb4b7e1eb1c7bb49f0))
15
- * enable custom setting menu sections with slotProps ([013fb63](https://gitlab.kkinternal.com/playback/web-playcraft/commit/013fb6393d7cc17502db6ef36b8b6d9492787529))
16
14
  * export MenuItem + styles of LanguageMenu for custom menu component ([4f37d2e](https://gitlab.kkinternal.com/playback/web-playcraft/commit/4f37d2ed793287885e69dead576ceb1cecbe3320))
17
- * **text:** add style for shaka player text display container ([39e62ec](https://gitlab.kkinternal.com/playback/web-playcraft/commit/39e62eccf99f394d12d682cd3b4a1a5ad1a398b3))
18
- * **text:** patch vertical text display style ([7725796](https://gitlab.kkinternal.com/playback/web-playcraft/commit/7725796e0d5ef77a6728c88296519eb809f090c5))
19
- * **text:** remove extra styles from ruby/rt to display properly ([4c77c61](https://gitlab.kkinternal.com/playback/web-playcraft/commit/4c77c61436a28fbdcc69e2bde0cd670681f7fadb))
20
15
  * **ui:** add close button to mobile language menu ([6704ce1](https://gitlab.kkinternal.com/playback/web-playcraft/commit/6704ce14b13e8e5f344615ca43220b3b8f79b5f8))
16
+ * enable custom setting menu sections with slotProps ([013fb63](https://gitlab.kkinternal.com/playback/web-playcraft/commit/013fb6393d7cc17502db6ef36b8b6d9492787529))
21
17
  * integrate new audio/subtitle menu to player UI ([d0944cb](https://gitlab.kkinternal.com/playback/web-playcraft/commit/d0944cb469342ae5eb84cd212a17835559e25115))
22
18
  * **ui:** add LanguageMenu component ([3ec5456](https://gitlab.kkinternal.com/playback/web-playcraft/commit/3ec5456eb1003b9374505e53bde56d967fef0b68))
23
19
  * **ui:** add OverlayPanel for custom setting menu ([dede035](https://gitlab.kkinternal.com/playback/web-playcraft/commit/dede03515b414c7e4afe7b6cb9c687097d46e920))
24
20
  * **ui:** add subtitles icon ([e771220](https://gitlab.kkinternal.com/playback/web-playcraft/commit/e7712208a8594aaf7211d55445fb5d4519e776e3))
21
+
22
+ ## [2.25.0-canary.1](https://gitlab.kkinternal.com/playback/web-playcraft/compare/v2.9.20...v2.25.0-canary.1) (2025-11-21)
23
+
24
+
25
+ ### Features
26
+
25
27
  * add support of external text track / subtitle ([2d2aa9f](https://gitlab.kkinternal.com/playback/web-playcraft/commit/2d2aa9f8b624749795b76f80551dbeca40359a79))
28
+ * **text:** add style for shaka player text display container ([39e62ec](https://gitlab.kkinternal.com/playback/web-playcraft/commit/39e62eccf99f394d12d682cd3b4a1a5ad1a398b3))
29
+ * **text:** patch vertical text display style ([7725796](https://gitlab.kkinternal.com/playback/web-playcraft/commit/7725796e0d5ef77a6728c88296519eb809f090c5))
30
+ * **text:** remove extra styles from ruby/rt to display properly ([4c77c61](https://gitlab.kkinternal.com/playback/web-playcraft/commit/4c77c61436a28fbdcc69e2bde0cd670681f7fadb))
31
+ * add castMedia export with error handling added ([82aa0b6](https://gitlab.kkinternal.com/playback/web-playcraft/commit/82aa0b608aad2f2e5c638b20ca3254298ec77291))
32
+ * basic HLS on MSE ([b02c6f0](https://gitlab.kkinternal.com/playback/web-playcraft/commit/b02c6f0f44a89000aed9f279c1715bb4d0d115dc))
26
33
  * enable Shaka player built-in text/subtitle display ([47375d6](https://gitlab.kkinternal.com/playback/web-playcraft/commit/47375d639a94df07e0919a79560f0202540f46fa))
27
34
  * expose audio track info ([87426d7](https://gitlab.kkinternal.com/playback/web-playcraft/commit/87426d710262baaa347e07ef7c21cd129671d834))
28
35
  * give subtitle a bottom magin while controller is hidden ([6444f6a](https://gitlab.kkinternal.com/playback/web-playcraft/commit/6444f6a5bfe9ed6a040c78e8317a67bcf136fa41))
@@ -44,6 +51,7 @@ All notable changes to this project will be documented in this file. See [standa
44
51
  * load sender framework only while the application id exists ([0b0caa9](https://gitlab.kkinternal.com/playback/web-playcraft/commit/0b0caa9e1546af4e2bb5ad6fbed1170dcfe460bd))
45
52
  * maintain text track / subtitle setting after Safari quality switch ([74837cc](https://gitlab.kkinternal.com/playback/web-playcraft/commit/74837cc7ec3c7ec7d93f46d37e73e00810878985))
46
53
  * match subtitle value as off while subtitle is undefined ([4f8ebd2](https://gitlab.kkinternal.com/playback/web-playcraft/commit/4f8ebd2bfbde374215ec08ff4e3594c78f382799))
54
+ * select DASH/HLS base on DRM key system availablity ([623e1e2](https://gitlab.kkinternal.com/playback/web-playcraft/commit/623e1e2ca77b7313e1ec845b391e4c92166686b8))
47
55
  * turn off subtitles when starting playback in iOS browsers ([9afbbf1](https://gitlab.kkinternal.com/playback/web-playcraft/commit/9afbbf1516b0007435153311418c1afc2bcba3df))
48
56
  * **core:** provide audio tracks without duplicate variantTracks ([799525d](https://gitlab.kkinternal.com/playback/web-playcraft/commit/799525d8b2e7af4417849ac6517ba194644dd720))
49
57
  * should use track.label instead of .name ([249b606](https://gitlab.kkinternal.com/playback/web-playcraft/commit/249b6064d8ed444917aaa0d0465269f7610f111d))
package/dist/core.mjs CHANGED
@@ -2,15 +2,15 @@ import UAParser from 'ua-parser-js';
2
2
 
3
3
  /* eslint-disable no-plusplus */
4
4
  new UAParser();
5
+
6
+ const isSafari = () => /^((?!chrome|android|X11|Linux).)*(safari|iPad|iPhone|Version)/i.test(navigator.userAgent);
7
+
5
8
  function needNativeHls() {
6
9
  // Don't let Android phones play HLS, even if some of them report supported
7
10
  // This covers Samsung & OPPO special cases
8
- const isAndroid = /android|X11|Linux/i.test(navigator.userAgent); // canPlayType isn't reliable across all iOS verion / device combinations, so also check user agent
9
-
10
- const isSafari = /^((?!chrome|android|X11|Linux).)*(safari|iPad|iPhone|Version)/i.test(navigator.userAgent); // ref: https://stackoverflow.com/a/12905122/4578017
11
- // none of our supported browsers other than Safari response to this
12
-
13
- return isAndroid || /firefox/i.test(navigator.userAgent) ? '' : isSafari ? 'maybe' : document.createElement('video').canPlayType('application/vnd.apple.mpegURL');
11
+ const isAndroid = /android|X11|Linux/i.test(navigator.userAgent);
12
+ return isAndroid || /firefox/i.test(navigator.userAgent) ? '' : // canPlayType isn't reliable across all iOS verion / device combinations, so also check user agent
13
+ isSafari() ? 'maybe' : document.createElement('video').canPlayType('application/vnd.apple.mpegURL');
14
14
  }
15
15
  // navigator.maxTouchPoints() is not supported in Safari 11, iOS Safari 11.0-11.2 compat/compat
16
16
 
@@ -45,7 +45,7 @@ const waitFor = (check, handler) => {
45
45
  function getVersion() {
46
46
  try {
47
47
  // eslint-disable-next-line no-undef
48
- return "2.25.0-canary.0";
48
+ return "2.25.0-canary.2";
49
49
  } catch (e) {
50
50
  return undefined;
51
51
  }
@@ -1675,7 +1675,7 @@ const loadShaka = async (videoElement, config = {}, options = {}) => {
1675
1675
  // See: https://github.com/shaka-project/shaka-player/issues/3526
1676
1676
  safeSeekOffset: 0,
1677
1677
  rebufferingGoal: 0,
1678
- ...(needNativeHls() && {
1678
+ ...(isSafari() && {
1679
1679
  preferNativeHls: true
1680
1680
  }),
1681
1681
  ...config.streaming
@@ -1767,7 +1767,7 @@ const loadShaka = async (videoElement, config = {}, options = {}) => {
1767
1767
  responseHandlers: [rewriteDashManifest]
1768
1768
  };
1769
1769
 
1770
- if (needNativeHls()) {
1770
+ if (isSafari()) {
1771
1771
  setupKKFariplay(player, extensionOptions);
1772
1772
  }
1773
1773
 
@@ -1907,7 +1907,7 @@ const getDrmOptions$1 = fallbackDrm => {
1907
1907
  * @typedef {{hls: string, dash: string}} SourceObjectAlt backward compatiable form
1908
1908
  *
1909
1909
  * @param {SourceObject[]|SourceObject|SourceObjectAlt|string} sourceOptions
1910
- * @param {{preferManifestType?: ('dash'|'hls')}} options
1910
+ * @param {{preferManifestType?: ('dash'|'hls'|'platform')}} options
1911
1911
  * @return {{src: string, type: string, drm: Object}}
1912
1912
  */
1913
1913
 
@@ -1950,7 +1950,8 @@ const getSource = (sourceOptions, {
1950
1950
  });
1951
1951
  }
1952
1952
 
1953
- const matched = sourceOptions.find(source => !preferManifestType || matchType(source, preferManifestType));
1953
+ const targetType = preferManifestType !== 'platform' ? preferManifestType : isSafari() ? 'hls' : 'dash';
1954
+ const matched = sourceOptions.find(source => matchType(source, targetType));
1954
1955
  const selected = matched || sourceOptions[0];
1955
1956
 
1956
1957
  if (!selected) {
@@ -2288,9 +2289,8 @@ const load = async (media, {
2288
2289
  startTime,
2289
2290
  plugins = []
2290
2291
  }, source) => {
2291
- const preferManifestType = needNativeHls() ? 'hls' : 'dash';
2292
2292
  const preferred = getSource(source, {
2293
- preferManifestType
2293
+ preferManifestType: 'platform'
2294
2294
  }); // There's no use case that changing DRM options without changing manifest URL, just skip
2295
2295
 
2296
2296
  if (player.lastSrc === (preferred === null || preferred === void 0 ? void 0 : preferred.src)) {
@@ -2310,7 +2310,7 @@ const load = async (media, {
2310
2310
  player,
2311
2311
  source: currentSource,
2312
2312
  startTime,
2313
- streamFormat: preferManifestType,
2313
+ streamFormat: source.type,
2314
2314
  reload: async () => {
2315
2315
  // Bitmovin unexpectedly restores muted state, so save to restore
2316
2316
  const restoreMuted = player.isMuted && {