@kkcompany/player 2.25.0-canary.0 → 2.25.0-canary.1
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 +5 -14
- package/dist/core.mjs +22 -20
- package/dist/index.js +2085 -2379
- package/dist/index.mjs +105 -392
- package/dist/modules.mjs +29 -38
- package/dist/plugins.mjs +4 -3
- package/dist/react.mjs +172 -434
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,27 +2,17 @@
|
|
|
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.
|
|
5
|
+
## [2.25.0-canary.1](https://gitlab.kkinternal.com/playback/web-playcraft/compare/v2.9.20...v2.25.0-canary.1) (2025-11-21)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
### Features
|
|
9
9
|
|
|
10
|
-
* add
|
|
11
|
-
* 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))
|
|
13
|
-
* display audio / subtitle options even if there's only 1 ([2e23915](https://gitlab.kkinternal.com/playback/web-playcraft/commit/2e23915d7aa7d084b65c9729c8ac468690852eb3))
|
|
14
|
-
* 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
|
-
* export MenuItem + styles of LanguageMenu for custom menu component ([4f37d2e](https://gitlab.kkinternal.com/playback/web-playcraft/commit/4f37d2ed793287885e69dead576ceb1cecbe3320))
|
|
10
|
+
* add support of external text track / subtitle ([2d2aa9f](https://gitlab.kkinternal.com/playback/web-playcraft/commit/2d2aa9f8b624749795b76f80551dbeca40359a79))
|
|
17
11
|
* **text:** add style for shaka player text display container ([39e62ec](https://gitlab.kkinternal.com/playback/web-playcraft/commit/39e62eccf99f394d12d682cd3b4a1a5ad1a398b3))
|
|
18
12
|
* **text:** patch vertical text display style ([7725796](https://gitlab.kkinternal.com/playback/web-playcraft/commit/7725796e0d5ef77a6728c88296519eb809f090c5))
|
|
19
13
|
* **text:** remove extra styles from ruby/rt to display properly ([4c77c61](https://gitlab.kkinternal.com/playback/web-playcraft/commit/4c77c61436a28fbdcc69e2bde0cd670681f7fadb))
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* **ui:** add LanguageMenu component ([3ec5456](https://gitlab.kkinternal.com/playback/web-playcraft/commit/3ec5456eb1003b9374505e53bde56d967fef0b68))
|
|
23
|
-
* **ui:** add OverlayPanel for custom setting menu ([dede035](https://gitlab.kkinternal.com/playback/web-playcraft/commit/dede03515b414c7e4afe7b6cb9c687097d46e920))
|
|
24
|
-
* **ui:** add subtitles icon ([e771220](https://gitlab.kkinternal.com/playback/web-playcraft/commit/e7712208a8594aaf7211d55445fb5d4519e776e3))
|
|
25
|
-
* add support of external text track / subtitle ([2d2aa9f](https://gitlab.kkinternal.com/playback/web-playcraft/commit/2d2aa9f8b624749795b76f80551dbeca40359a79))
|
|
14
|
+
* add castMedia export with error handling added ([82aa0b6](https://gitlab.kkinternal.com/playback/web-playcraft/commit/82aa0b608aad2f2e5c638b20ca3254298ec77291))
|
|
15
|
+
* basic HLS on MSE ([b02c6f0](https://gitlab.kkinternal.com/playback/web-playcraft/commit/b02c6f0f44a89000aed9f279c1715bb4d0d115dc))
|
|
26
16
|
* enable Shaka player built-in text/subtitle display ([47375d6](https://gitlab.kkinternal.com/playback/web-playcraft/commit/47375d639a94df07e0919a79560f0202540f46fa))
|
|
27
17
|
* expose audio track info ([87426d7](https://gitlab.kkinternal.com/playback/web-playcraft/commit/87426d710262baaa347e07ef7c21cd129671d834))
|
|
28
18
|
* give subtitle a bottom magin while controller is hidden ([6444f6a](https://gitlab.kkinternal.com/playback/web-playcraft/commit/6444f6a5bfe9ed6a040c78e8317a67bcf136fa41))
|
|
@@ -44,6 +34,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
44
34
|
* load sender framework only while the application id exists ([0b0caa9](https://gitlab.kkinternal.com/playback/web-playcraft/commit/0b0caa9e1546af4e2bb5ad6fbed1170dcfe460bd))
|
|
45
35
|
* maintain text track / subtitle setting after Safari quality switch ([74837cc](https://gitlab.kkinternal.com/playback/web-playcraft/commit/74837cc7ec3c7ec7d93f46d37e73e00810878985))
|
|
46
36
|
* match subtitle value as off while subtitle is undefined ([4f8ebd2](https://gitlab.kkinternal.com/playback/web-playcraft/commit/4f8ebd2bfbde374215ec08ff4e3594c78f382799))
|
|
37
|
+
* select DASH/HLS base on DRM key system availablity ([623e1e2](https://gitlab.kkinternal.com/playback/web-playcraft/commit/623e1e2ca77b7313e1ec845b391e4c92166686b8))
|
|
47
38
|
* turn off subtitles when starting playback in iOS browsers ([9afbbf1](https://gitlab.kkinternal.com/playback/web-playcraft/commit/9afbbf1516b0007435153311418c1afc2bcba3df))
|
|
48
39
|
* **core:** provide audio tracks without duplicate variantTracks ([799525d](https://gitlab.kkinternal.com/playback/web-playcraft/commit/799525d8b2e7af4417849ac6517ba194644dd720))
|
|
49
40
|
* 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);
|
|
9
|
-
|
|
10
|
-
|
|
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.
|
|
48
|
+
return "2.25.0-canary.1";
|
|
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
|
-
...(
|
|
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 (
|
|
1770
|
+
if (isSafari()) {
|
|
1771
1771
|
setupKKFariplay(player, extensionOptions);
|
|
1772
1772
|
}
|
|
1773
1773
|
|
|
@@ -1828,6 +1828,11 @@ const loadShaka = async (videoElement, config = {}, options = {}) => {
|
|
|
1828
1828
|
},
|
|
1829
1829
|
getPlaybackSpeed: () => videoElement.playbackRate,
|
|
1830
1830
|
getVideoElement: () => videoElement,
|
|
1831
|
+
setQuality: restrictions => {
|
|
1832
|
+
if (!restrictions) return; // FIXME: Setting restrictions to {} cannot enable abr.
|
|
1833
|
+
|
|
1834
|
+
player.configure('abr.restrictions', restrictions);
|
|
1835
|
+
},
|
|
1831
1836
|
getVideoQuality,
|
|
1832
1837
|
getAvailableVideoQualities,
|
|
1833
1838
|
isAlive: () => player.getLoadMode() !== shaka.Player.LoadMode.DESTROYED,
|
|
@@ -1907,7 +1912,7 @@ const getDrmOptions$1 = fallbackDrm => {
|
|
|
1907
1912
|
* @typedef {{hls: string, dash: string}} SourceObjectAlt backward compatiable form
|
|
1908
1913
|
*
|
|
1909
1914
|
* @param {SourceObject[]|SourceObject|SourceObjectAlt|string} sourceOptions
|
|
1910
|
-
* @param {{preferManifestType?: ('dash'|'hls')}} options
|
|
1915
|
+
* @param {{preferManifestType?: ('dash'|'hls'|'platform')}} options
|
|
1911
1916
|
* @return {{src: string, type: string, drm: Object}}
|
|
1912
1917
|
*/
|
|
1913
1918
|
|
|
@@ -1950,7 +1955,8 @@ const getSource = (sourceOptions, {
|
|
|
1950
1955
|
});
|
|
1951
1956
|
}
|
|
1952
1957
|
|
|
1953
|
-
const
|
|
1958
|
+
const targetType = preferManifestType !== 'platform' ? preferManifestType : isSafari() ? 'hls' : 'dash';
|
|
1959
|
+
const matched = sourceOptions.find(source => matchType(source, targetType));
|
|
1954
1960
|
const selected = matched || sourceOptions[0];
|
|
1955
1961
|
|
|
1956
1962
|
if (!selected) {
|
|
@@ -2020,8 +2026,6 @@ const getDrmOptions = source => {
|
|
|
2020
2026
|
}];
|
|
2021
2027
|
};
|
|
2022
2028
|
|
|
2023
|
-
/* eslint-disable no-param-reassign */
|
|
2024
|
-
|
|
2025
2029
|
const matchAll = (input, pattern) => {
|
|
2026
2030
|
const flags = [pattern.global && 'g', pattern.ignoreCase && 'i', pattern.multiline && 'm'].filter(Boolean).join('');
|
|
2027
2031
|
const clone = new RegExp(pattern, flags);
|
|
@@ -2229,7 +2233,7 @@ const tryPatchHlsVideoQualities = async (player, hlsUrl) => {
|
|
|
2229
2233
|
const videoQualities = getHlsQualityOptions(manifest);
|
|
2230
2234
|
|
|
2231
2235
|
if (videoQualities) {
|
|
2232
|
-
player.
|
|
2236
|
+
player.getAvailableVideoQualities = () => videoQualities;
|
|
2233
2237
|
}
|
|
2234
2238
|
};
|
|
2235
2239
|
|
|
@@ -2288,9 +2292,8 @@ const load = async (media, {
|
|
|
2288
2292
|
startTime,
|
|
2289
2293
|
plugins = []
|
|
2290
2294
|
}, source) => {
|
|
2291
|
-
const preferManifestType = needNativeHls() ? 'hls' : 'dash';
|
|
2292
2295
|
const preferred = getSource(source, {
|
|
2293
|
-
preferManifestType
|
|
2296
|
+
preferManifestType: 'platform'
|
|
2294
2297
|
}); // There's no use case that changing DRM options without changing manifest URL, just skip
|
|
2295
2298
|
|
|
2296
2299
|
if (player.lastSrc === (preferred === null || preferred === void 0 ? void 0 : preferred.src)) {
|
|
@@ -2310,7 +2313,7 @@ const load = async (media, {
|
|
|
2310
2313
|
player,
|
|
2311
2314
|
source: currentSource,
|
|
2312
2315
|
startTime,
|
|
2313
|
-
streamFormat:
|
|
2316
|
+
streamFormat: source.type,
|
|
2314
2317
|
reload: async () => {
|
|
2315
2318
|
// Bitmovin unexpectedly restores muted state, so save to restore
|
|
2316
2319
|
const restoreMuted = player.isMuted && {
|
|
@@ -2383,7 +2386,7 @@ const load = async (media, {
|
|
|
2383
2386
|
loadStartTime = merged.startTime;
|
|
2384
2387
|
}
|
|
2385
2388
|
|
|
2386
|
-
if (
|
|
2389
|
+
if (merged.type === 'application/x-mpegurl') {
|
|
2387
2390
|
await tryPatchHlsVideoQualities(player, merged.src);
|
|
2388
2391
|
}
|
|
2389
2392
|
|
|
@@ -2488,8 +2491,7 @@ const loadPlayer = async (videoElement, {
|
|
|
2488
2491
|
|
|
2489
2492
|
reloadOnLiveStall(videoElement, {
|
|
2490
2493
|
reload: () => player.reload()
|
|
2491
|
-
});
|
|
2492
|
-
player.preferredSettings = {}; // TODO load built-in modules here
|
|
2494
|
+
}); // TODO load built-in modules here
|
|
2493
2495
|
|
|
2494
2496
|
player.modules = {};
|
|
2495
2497
|
return player;
|