@m4l/gclick 0.32.0 → 0.33.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/components/VideoPlayer/VideoPlayer.d.ts +7 -6
- package/components/VideoPlayer/VideoPlayer.d.ts.map +1 -1
- package/components/VideoPlayer/VideoPlayer.styles.d.ts +4 -5
- package/components/VideoPlayer/VideoPlayer.styles.d.ts.map +1 -1
- package/components/VideoPlayer/VideoPlayer.styles.js +27 -28
- package/components/VideoPlayer/VideojsDefaultSkin.styles.d.ts.map +1 -1
- package/components/VideoPlayer/VideojsDefaultSkin.styles.js +330 -397
- package/components/VideoPlayer/{VideojsMinimalSkin.styles.d.ts → VideojsNeutralSkin.styles.d.ts} +2 -2
- package/components/VideoPlayer/VideojsNeutralSkin.styles.d.ts.map +1 -0
- package/components/VideoPlayer/{VideojsMinimalSkin.styles.js → VideojsNeutralSkin.styles.js} +618 -672
- package/components/VideoPlayer/constants.d.ts +24 -7
- package/components/VideoPlayer/constants.d.ts.map +1 -1
- package/components/VideoPlayer/constants.js +12 -8
- package/components/VideoPlayer/hlsSource.d.ts +17 -9
- package/components/VideoPlayer/hlsSource.d.ts.map +1 -1
- package/components/VideoPlayer/hooks/useAccessErrorReporter.d.ts +4 -4
- package/components/VideoPlayer/hooks/useAccessErrorReporter.js +9 -9
- package/components/VideoPlayer/hooks/useMediaReadiness.d.ts +6 -7
- package/components/VideoPlayer/hooks/useMediaReadiness.d.ts.map +1 -1
- package/components/VideoPlayer/hooks/usePlayerControl.d.ts +6 -5
- package/components/VideoPlayer/hooks/usePlayerControl.d.ts.map +1 -1
- package/components/VideoPlayer/hooks/usePlayerControl.js +14 -11
- package/components/VideoPlayer/hooks/usePlayerEvents.d.ts +9 -4
- package/components/VideoPlayer/hooks/usePlayerEvents.d.ts.map +1 -1
- package/components/VideoPlayer/subcomponents/GclickVideoSkin.d.ts +7 -6
- package/components/VideoPlayer/subcomponents/GclickVideoSkin.d.ts.map +1 -1
- package/components/VideoPlayer/subcomponents/GclickVideoSkin.js +35 -35
- package/components/VideoPlayer/subcomponents/VideoPlayerStage.d.ts +1 -1
- package/components/VideoPlayer/subcomponents/VideoPlayerStage.d.ts.map +1 -1
- package/components/VideoPlayer/subcomponents/VideoPlayerStage.js +16 -15
- package/components/VideoPlayer/subcomponents/skin/LiveButton.d.ts +24 -0
- package/components/VideoPlayer/subcomponents/skin/LiveButton.d.ts.map +1 -0
- package/components/VideoPlayer/subcomponents/skin/LiveButton.js +53 -0
- package/components/VideoPlayer/subcomponents/skin/MinimalVideoControls.d.ts +2 -2
- package/components/VideoPlayer/subcomponents/skin/VideoErrorDialog.d.ts +3 -3
- package/components/VideoPlayer/subcomponents/skin/VideoStatusIndicators.d.ts +2 -2
- package/components/VideoPlayer/subcomponents/skin/buttons.d.ts +2 -2
- package/components/VideoPlayer/subcomponents/skin/buttons.d.ts.map +1 -1
- package/components/VideoPlayer/subcomponents/skin/buttons.js +14 -13
- package/components/VideoPlayer/subcomponents/skin/skinVariant.d.ts +3 -0
- package/components/VideoPlayer/subcomponents/skin/skinVariant.d.ts.map +1 -1
- package/components/VideoPlayer/subcomponents/skin/skinVariant.js +53 -51
- package/components/VideoPlayer/types.d.ts +7 -5
- package/components/VideoPlayer/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/components/VideoPlayer/VideojsMinimalSkin.styles.d.ts.map +0 -1
|
@@ -2,19 +2,36 @@
|
|
|
2
2
|
export declare const COMPONENT_VIDEO_PLAYER_KEY_COMPONENT = "M4LVideoPlayer";
|
|
3
3
|
export declare const COMPONENT_VIDEO_PLAYER_TEST_ID = "M4LVideoPlayer";
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The skins the player can wear, by their public name. The names are our API
|
|
6
|
+
* and do not follow the vendor's: `minimal` wears the vendor's Neutral skin,
|
|
7
|
+
* which `@videojs/react` called Minimal until 10.0.0-rc.5 (v10#3092). The
|
|
8
|
+
* `data-theme` each one renders is an internal mapping
|
|
9
|
+
* (`VIDEO_PLAYER_VENDOR_THEMES` in this file).
|
|
8
10
|
*/
|
|
9
11
|
export declare const VIDEO_PLAYER_VARIANTS: {
|
|
10
12
|
readonly default: "default";
|
|
11
13
|
readonly minimal: "minimal";
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `
|
|
16
|
+
* The vendor theme each variant wears: the `data-theme` its skin root renders,
|
|
17
|
+
* which nearly every rule of the translated sheet selects on. A wrong value
|
|
18
|
+
* leaves the chrome unstyled with no error, so `GclickVideoSkin.test.tsx` holds
|
|
19
|
+
* the rendered root against the manifest's `theme`
|
|
20
|
+
* (`scripts/vendor-css/manifest.mjs`), and `vendorSkins.styles.test.ts` holds
|
|
21
|
+
* that `theme` against the sheet. Internal: not exported from the package.
|
|
22
|
+
*/
|
|
23
|
+
export declare const VIDEO_PLAYER_VENDOR_THEMES: {
|
|
24
|
+
readonly default: "default";
|
|
25
|
+
readonly minimal: "neutral";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* `crossOrigin` value applied to the `<video>` element. `use-credentials`
|
|
29
|
+
* makes the browser send the CloudFront signed cookies on the native/Safari
|
|
30
|
+
* HLS path, and the hls.js adapter reads it on every request it sends, so it
|
|
31
|
+
* covers the hls.js/MSE path too. The loader hooks `buildCredentialedHlsEngine`
|
|
32
|
+
* sets stay on that path as well: on the attribute alone, a request sent while
|
|
33
|
+
* no element is attached, or a lost attribute, would leave without cookies,
|
|
34
|
+
* silently.
|
|
18
35
|
*/
|
|
19
36
|
export declare const HLS_CROSS_ORIGIN: "use-credentials";
|
|
20
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/VideoPlayer/constants.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,eAAO,MAAM,oCAAoC,mBAAmB,CAAC;AACrE,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/VideoPlayer/constants.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,eAAO,MAAM,oCAAoC,mBAAmB,CAAC;AACrE,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAE/D;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;CAGgC,CAAC;AAExE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAG,iBAA0B,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAG,KAAc,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;;CAIjC,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,QAAY,CAAC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
const _ = "M4LVideoPlayer",
|
|
1
|
+
const _ = "M4LVideoPlayer", E = {
|
|
2
2
|
default: "default",
|
|
3
3
|
minimal: "minimal"
|
|
4
|
-
}, e =
|
|
4
|
+
}, e = {
|
|
5
|
+
default: "default",
|
|
6
|
+
minimal: "neutral"
|
|
7
|
+
}, O = "use-credentials", t = "mse", a = {
|
|
5
8
|
cast: !1,
|
|
6
9
|
airPlay: !1,
|
|
7
10
|
pictureInPicture: !1
|
|
8
|
-
},
|
|
11
|
+
}, R = 10 * 1e3;
|
|
9
12
|
export {
|
|
10
|
-
|
|
13
|
+
R as ACCESS_ERROR_REPORT_WINDOW_MS,
|
|
11
14
|
_ as COMPONENT_VIDEO_PLAYER_KEY_COMPONENT,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
O as HLS_CROSS_ORIGIN,
|
|
16
|
+
t as HLS_PREFER_PLAYBACK,
|
|
17
|
+
a as VIDEO_PLAYER_OPTIONAL_CONTROLS,
|
|
18
|
+
E as VIDEO_PLAYER_VARIANTS,
|
|
19
|
+
e as VIDEO_PLAYER_VENDOR_THEMES
|
|
16
20
|
};
|
|
@@ -13,11 +13,13 @@ export type HlsEngineOptions = NonNullable<HlsSource['engine']>;
|
|
|
13
13
|
* beta.24 it was flat (`preferPlayback` a top-level prop, `config` the hls.js
|
|
14
14
|
* bag), beta.25 nested both under a single `config` prop, and beta.32 replaced
|
|
15
15
|
* `config` with `source` and namespaced the engine options under
|
|
16
|
-
* `source.engine.hlsJs`. rc.4
|
|
17
|
-
*
|
|
18
|
-
* defaults
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* `source.engine.hlsJs`. rc.4 moved the adapter to its own package
|
|
17
|
+
* (`@videojs/hlsjs-video`), which spreads `engine.hlsJs` over its hls.js
|
|
18
|
+
* defaults, and 10.1.0 wraps the two loader hooks in the adapter's own
|
|
19
|
+
* (v10#2870, see below). Getting the shape wrong fails SILENTLY: the loader
|
|
20
|
+
* hooks below never reach hls.js, the access errors go unobserved and the
|
|
21
|
+
* cookies hang on the `crossOrigin` attribute alone, with no error surfaced by
|
|
22
|
+
* the player. Keep the nesting.
|
|
21
23
|
*
|
|
22
24
|
* Build this object ONCE per mounted player and reuse it across renders and
|
|
23
25
|
* `src` changes (`buildHlsSource` only wraps a new URL around it). The element
|
|
@@ -42,8 +44,8 @@ export type HlsEngineOptions = NonNullable<HlsSource['engine']>;
|
|
|
42
44
|
* `status 0`. hls.js raises an `ERROR` for it, but a non-fatal one while it can
|
|
43
45
|
* carry on: a refused live segment becomes a gap, a live playlist reload is
|
|
44
46
|
* retried twice and a VOD segment six times (about 30 s) before it gives up;
|
|
45
|
-
* only the first manifest is fatal at once. The
|
|
46
|
-
*
|
|
47
|
+
* only the first manifest is fatal at once. The adapter forwards fatal errors
|
|
48
|
+
* alone to the element (`HlsJsErrorsMixin`), so until then the player's
|
|
47
49
|
* `error` never changes. Listening on the request itself is the one place that
|
|
48
50
|
* sees every manifest, playlist, segment and key as it fails (see
|
|
49
51
|
* `createAccessErrorXhrObserver`).
|
|
@@ -54,8 +56,14 @@ export type HlsEngineOptions = NonNullable<HlsSource['engine']>;
|
|
|
54
56
|
* element as it resizes so fullscreen lifts it again, and the 720p floor keeps
|
|
55
57
|
* a small tile off the bottom rungs of the ladder.
|
|
56
58
|
*
|
|
57
|
-
* The
|
|
58
|
-
*
|
|
59
|
+
* The `crossOrigin` attribute on `<HlsJsVideo>` (see {@link HLS_CROSS_ORIGIN})
|
|
60
|
+
* covers the native/Safari HLS path, which bypasses hls.js entirely. The
|
|
61
|
+
* adapter also reads it on every hls.js request: its own hooks set the same
|
|
62
|
+
* credentials when it is `use-credentials` and then call ours, on the same
|
|
63
|
+
* request. Ours stay: the adapter reads the attribute off the attached
|
|
64
|
+
* element, so with the attribute alone a request sent while none is attached,
|
|
65
|
+
* or a lost attribute, would leave without cookies, silently.
|
|
66
|
+
*
|
|
59
67
|
* Credentialed CORS forbids `Access-Control-Allow-Origin: *`, so CloudFront
|
|
60
68
|
* must echo the exact request origin and send
|
|
61
69
|
* `Access-Control-Allow-Credentials: true` for the segments to authenticate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hlsSource.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/VideoPlayer/hlsSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,8GAA8G;AAC9G,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AAYhE
|
|
1
|
+
{"version":3,"file":"hlsSource.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/VideoPlayer/hlsSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,8GAA8G;AAC9G,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AAYhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAsBrF;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAAC,EAC3C,MAAM,EAAE,gBAAgB,GACvB,SAAS,CAEX"}
|
|
@@ -4,9 +4,9 @@ import { VideoPlayerAccessError } from '../types';
|
|
|
4
4
|
/**
|
|
5
5
|
* Turn the consumer's `onAccessError` into a stable reporter that forwards at
|
|
6
6
|
* most one error per {@link ACCESS_ERROR_REPORT_WINDOW_MS}, completed with what
|
|
7
|
-
* `
|
|
8
|
-
* inline callback never changes the reporter's identity,
|
|
9
|
-
* the hls.js engine configuration stable.
|
|
7
|
+
* the `<video>` behind `videoRef` had played by then. The handler is read
|
|
8
|
+
* through a ref so an inline callback never changes the reporter's identity,
|
|
9
|
+
* which in turn keeps the hls.js engine configuration stable.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useAccessErrorReporter(onAccessError: ((info: VideoPlayerAccessError) => void) | undefined,
|
|
11
|
+
export declare function useAccessErrorReporter(onAccessError: ((info: VideoPlayerAccessError) => void) | undefined, videoRef: RefObject<HTMLMediaElement | null>): AccessErrorReporter;
|
|
12
12
|
//# sourceMappingURL=useAccessErrorReporter.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { useRef as c, useCallback as s } from "react";
|
|
2
2
|
import { ACCESS_ERROR_REPORT_WINDOW_MS as R } from "../constants.js";
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
function m(e, n) {
|
|
4
|
+
const u = c(e);
|
|
5
|
+
u.current = e;
|
|
6
6
|
const t = c(null);
|
|
7
7
|
return s((a) => {
|
|
8
|
-
const
|
|
9
|
-
if (t.current !== null &&
|
|
8
|
+
const l = Date.now();
|
|
9
|
+
if (t.current !== null && l - t.current < R)
|
|
10
10
|
return;
|
|
11
|
-
t.current =
|
|
11
|
+
t.current = l;
|
|
12
12
|
const r = n.current?.played;
|
|
13
|
-
|
|
13
|
+
u.current?.({
|
|
14
14
|
...a,
|
|
15
|
-
played: r ? Array.from({ length: r.length }, (p,
|
|
15
|
+
played: r ? Array.from({ length: r.length }, (p, o) => ({ start: r.start(o), end: r.end(o) })) : []
|
|
16
16
|
});
|
|
17
17
|
}, [n]);
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
m as useAccessErrorReporter
|
|
21
21
|
};
|
|
@@ -3,13 +3,12 @@ import { RefObject } from 'react';
|
|
|
3
3
|
* Call `onReady` every time the media element becomes able to start playing,
|
|
4
4
|
* and re-arm when it goes back to empty.
|
|
5
5
|
*
|
|
6
|
-
* The player store exposes `canPlay
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* autoplay only ever worked there.
|
|
6
|
+
* The player store exposes `canPlay` (`readyState >= HAVE_FUTURE_DATA`), but
|
|
7
|
+
* it rises later than this hook needs: HAVE_CURRENT_DATA, data for the current
|
|
8
|
+
* position, precedes HAVE_FUTURE_DATA, and the store re-reads `canPlay` only on
|
|
9
|
+
* `canplay`, `canplaythrough`, `loadstart` and `emptied`, so it waits on
|
|
10
|
+
* `canplay`, which Safari is erratic about (hls.js#1686), and it stays `true`
|
|
11
|
+
* when the element falls back below it.
|
|
13
12
|
*
|
|
14
13
|
* HAVE_CURRENT_DATA is the threshold that actually answers "can playback start",
|
|
15
14
|
* and it is the one MDN's own `readyState` example gates `play()` on.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaReadiness.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/hooks/useMediaReadiness.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc1D
|
|
1
|
+
{"version":3,"file":"useMediaReadiness.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/hooks/useMediaReadiness.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc1D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAC5C,OAAO,EAAE,MAAM,IAAI,GAClB,IAAI,CAkCN"}
|
|
@@ -7,11 +7,12 @@ import { VideoPlayerControl } from '../types';
|
|
|
7
7
|
* identity only changes when the store does. The handle is a thin store adapter
|
|
8
8
|
* — it deliberately exposes none of the underlying video.js internals.
|
|
9
9
|
*
|
|
10
|
-
* Reads prefer the element to `store.state`.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Reads prefer the element to `store.state`. The store's own actions (`play`,
|
|
11
|
+
* `pause`, `setMuted`) write their state at once, but a change made to the
|
|
12
|
+
* element from outside the store — the browser pausing it, the controls of a
|
|
13
|
+
* picture-in-picture window — only reaches the state on the element's next
|
|
14
|
+
* event (`volumechange`, `pause`, …), which the browser queues as a task. The
|
|
15
|
+
* element is the reading that is always current. The state answers while no
|
|
15
16
|
* element is mounted.
|
|
16
17
|
*
|
|
17
18
|
* Every mutation goes through `runStoreAction`, so the handle is inert — never
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePlayerControl.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/hooks/usePlayerControl.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAanD
|
|
1
|
+
{"version":3,"file":"usePlayerControl.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/hooks/usePlayerControl.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAanD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,GAAG,CAAC,kBAAkB,CAAC,GAAG,SAAS,EACxC,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAC3C,IAAI,CAkGN"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useImperativeHandle as
|
|
2
|
-
import { runStoreAction as u, absorbDetachedStoreRejection as
|
|
1
|
+
import { useImperativeHandle as d } from "react";
|
|
2
|
+
import { runStoreAction as u, absorbDetachedStoreRejection as m } from "../storeSafety.js";
|
|
3
3
|
import { resolveIsLive as l } from "../utils.js";
|
|
4
|
-
function
|
|
4
|
+
function p(r, t) {
|
|
5
5
|
const { muted: a, volume: e } = r ?? t.state;
|
|
6
6
|
return a || e === 0;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function v(r, t, a) {
|
|
9
|
+
d(r, () => ({
|
|
10
10
|
/** Resume playback, swallowing autoplay rejection. */
|
|
11
11
|
async play() {
|
|
12
12
|
try {
|
|
@@ -24,15 +24,18 @@ function g(r, t, a) {
|
|
|
24
24
|
isPaused() {
|
|
25
25
|
return a.current?.paused ?? t.state.paused ?? !1;
|
|
26
26
|
},
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Set the muted flag through the store's setter, which is idempotent and
|
|
29
|
+
* restores an audible level when it unmutes at volume 0.
|
|
30
|
+
*/
|
|
28
31
|
setMuted(e) {
|
|
29
|
-
|
|
30
|
-
t.
|
|
32
|
+
u(t, () => {
|
|
33
|
+
t.setMuted(e);
|
|
31
34
|
});
|
|
32
35
|
},
|
|
33
36
|
/** Whether the player is currently muted. */
|
|
34
37
|
isMuted() {
|
|
35
|
-
return
|
|
38
|
+
return p(a.current, t);
|
|
36
39
|
},
|
|
37
40
|
/** Whether the underlying manifest is still live. */
|
|
38
41
|
isLive() {
|
|
@@ -41,7 +44,7 @@ function g(r, t, a) {
|
|
|
41
44
|
/** Seek to `seconds`; no-op on live streams (no seekable window). */
|
|
42
45
|
seek(e) {
|
|
43
46
|
l(t.state.streamType, t.state.duration) || u(t, () => {
|
|
44
|
-
t.seek(e).catch(
|
|
47
|
+
t.seek(e).catch(m);
|
|
45
48
|
});
|
|
46
49
|
},
|
|
47
50
|
/** Set the playback rate. */
|
|
@@ -87,5 +90,5 @@ function g(r, t, a) {
|
|
|
87
90
|
}), [t, a]);
|
|
88
91
|
}
|
|
89
92
|
export {
|
|
90
|
-
|
|
93
|
+
v as usePlayerControl
|
|
91
94
|
};
|
|
@@ -15,10 +15,15 @@ export interface PlayerEventHandlers {
|
|
|
15
15
|
* the relevant primitives across changes. Handlers are read from a ref so
|
|
16
16
|
* consumers can pass inline callbacks without re-subscribing the listener.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* Each transition fires once. The store's `play()` and `pause()` write their
|
|
19
|
+
* state at once and notify subscribers on the next microtask, ahead of the
|
|
20
|
+
* element's `play` or `pause` event; when that event lands it finds the state
|
|
21
|
+
* already there, so the diff on `paused` sees a single change.
|
|
22
|
+
*
|
|
23
|
+
* Readiness is deliberately absent: the store's `canPlay` rises at
|
|
24
|
+
* HAVE_FUTURE_DATA, on `canplay`, later than the first frame. `onReady` is
|
|
25
|
+
* emitted from `useMediaReadiness` instead, which reads the element directly —
|
|
26
|
+
* see that hook for the full reasoning.
|
|
22
27
|
*/
|
|
23
28
|
export declare function usePlayerEvents(store: StreamPlayerStore, handlers: PlayerEventHandlers): void;
|
|
24
29
|
//# sourceMappingURL=usePlayerEvents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePlayerEvents.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/hooks/usePlayerEvents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAChE;AAED
|
|
1
|
+
{"version":3,"file":"usePlayerEvents.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/hooks/usePlayerEvents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAChE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,mBAAmB,GAC5B,IAAI,CA6CN"}
|
|
@@ -5,11 +5,12 @@ export interface GclickVideoSkinProps {
|
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
className?: string;
|
|
7
7
|
poster?: string;
|
|
8
|
-
/** While live: show the
|
|
8
|
+
/** While live: show the live button and hide the seek region. */
|
|
9
9
|
isLive: boolean;
|
|
10
10
|
/**
|
|
11
|
-
* Which
|
|
12
|
-
*
|
|
11
|
+
* Which skin to wear, by its public name. It sets the vendor theme the
|
|
12
|
+
* root's `data-theme` carries (`minimal` wears the vendor's `neutral`), the
|
|
13
|
+
* layout and the icons. The stylesheet itself is chosen by the `root` slot.
|
|
13
14
|
*/
|
|
14
15
|
variant: VideoPlayerVariant;
|
|
15
16
|
/** Opt in to the transport controls that are hidden by default. */
|
|
@@ -19,9 +20,9 @@ export interface GclickVideoSkinProps {
|
|
|
19
20
|
* Single official-v10 skin for both live and VOD, composed from the dependency's
|
|
20
21
|
* building blocks + official classes (styled by the vendor stylesheet translated
|
|
21
22
|
* to Emotion, scoped at the root slot; no custom per-control CSS). It unifies the
|
|
22
|
-
* VOD and live presets: while `isLive` the control bar shows the
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* VOD and live presets: while `isLive` the control bar shows the live button
|
|
24
|
+
* and drops the seek region; once the stream ends (`isLive` flips false) it
|
|
25
|
+
* shows the skip controls + the time slider. Because it is one
|
|
25
26
|
* component (no skin swap), the `<video>` is never remounted on the live → VOD
|
|
26
27
|
* transition.
|
|
27
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GclickVideoSkin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/GclickVideoSkin.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GclickVideoSkin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/GclickVideoSkin.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsCvC,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAUhF,oFAAoF;AACpF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,kBAAkB,CAAC;IAC5B,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;CAChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,EACP,gBAAgB,GACjB,EAAE,oBAAoB,GAAG,SAAS,CAalC"}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { Container as
|
|
3
|
-
import { VIDEO_PLAYER_VARIANTS as
|
|
4
|
-
import { cx as
|
|
5
|
-
import { DefaultVideoControls as
|
|
6
|
-
import { MinimalVideoControls as
|
|
7
|
-
import { SkinVariantProvider as
|
|
8
|
-
import { VideoErrorDialog as
|
|
1
|
+
import { jsx as i, jsxs as f } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Container as p, Poster as s, BufferingIndicator as l } from "@videojs/react";
|
|
3
|
+
import { VIDEO_PLAYER_VARIANTS as u, VIDEO_PLAYER_OPTIONAL_CONTROLS as V } from "../constants.js";
|
|
4
|
+
import { cx as I } from "./skin/buttons.js";
|
|
5
|
+
import { DefaultVideoControls as N } from "./skin/DefaultVideoControls.js";
|
|
6
|
+
import { MinimalVideoControls as S } from "./skin/MinimalVideoControls.js";
|
|
7
|
+
import { SkinVariantProvider as g, useSkinVariant as k } from "./skin/skinVariant.js";
|
|
8
|
+
import { VideoErrorDialog as h } from "./skin/VideoErrorDialog.js";
|
|
9
9
|
import { VideoInputBindings as O } from "./skin/VideoInputBindings.js";
|
|
10
|
-
import { VideoStatusIndicators as
|
|
11
|
-
function
|
|
12
|
-
children:
|
|
10
|
+
import { VideoStatusIndicators as A } from "./skin/VideoStatusIndicators.js";
|
|
11
|
+
function B({
|
|
12
|
+
children: o,
|
|
13
13
|
className: e,
|
|
14
|
-
poster:
|
|
14
|
+
poster: n,
|
|
15
15
|
isLive: r,
|
|
16
|
-
variant:
|
|
17
|
-
optionalControls:
|
|
16
|
+
variant: t,
|
|
17
|
+
optionalControls: a
|
|
18
18
|
}) {
|
|
19
|
-
return /* @__PURE__ */ i(
|
|
20
|
-
|
|
19
|
+
return /* @__PURE__ */ i(g, { variant: t, children: /* @__PURE__ */ i(
|
|
20
|
+
E,
|
|
21
21
|
{
|
|
22
22
|
className: e,
|
|
23
|
-
poster:
|
|
23
|
+
poster: n,
|
|
24
24
|
isLive: r,
|
|
25
|
-
optionalControls:
|
|
26
|
-
children:
|
|
25
|
+
optionalControls: a,
|
|
26
|
+
children: o
|
|
27
27
|
}
|
|
28
28
|
) });
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
children:
|
|
30
|
+
function E({
|
|
31
|
+
children: o,
|
|
32
32
|
className: e,
|
|
33
|
-
poster:
|
|
33
|
+
poster: n,
|
|
34
34
|
isLive: r,
|
|
35
|
-
optionalControls:
|
|
35
|
+
optionalControls: t
|
|
36
36
|
}) {
|
|
37
|
-
const { variant:
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
37
|
+
const { variant: a, theme: d, icons: c } = k(), m = { ...V, ...t };
|
|
38
|
+
return /* @__PURE__ */ f(
|
|
39
|
+
p,
|
|
40
40
|
{
|
|
41
|
-
className:
|
|
42
|
-
"data-theme":
|
|
41
|
+
className: I("media-skin media-container video-skin", e),
|
|
42
|
+
"data-theme": d,
|
|
43
43
|
"data-preset": "video",
|
|
44
44
|
children: [
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ i(s.Root, { className: "media-poster", children: /* @__PURE__ */ i(s.Image, { className: "media-poster-image", src:
|
|
47
|
-
/* @__PURE__ */ i(
|
|
48
|
-
/* @__PURE__ */ i(
|
|
49
|
-
|
|
45
|
+
o,
|
|
46
|
+
/* @__PURE__ */ i(s.Root, { className: "media-poster", children: /* @__PURE__ */ i(s.Image, { className: "media-poster-image", src: n }) }),
|
|
47
|
+
/* @__PURE__ */ i(l, { className: "media-buffering-indicator", children: /* @__PURE__ */ i(c.SpinnerIcon, { className: "media-buffering-indicator-spinner-icon" }) }),
|
|
48
|
+
/* @__PURE__ */ i(h, {}),
|
|
49
|
+
a === u.minimal ? /* @__PURE__ */ i(S, { isLive: r, outputs: m }) : /* @__PURE__ */ i(N, { isLive: r, outputs: m }),
|
|
50
50
|
/* @__PURE__ */ i(O, { isLive: r, outputs: m }),
|
|
51
|
-
/* @__PURE__ */ i(
|
|
51
|
+
/* @__PURE__ */ i(A, {})
|
|
52
52
|
]
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
B as GclickVideoSkin
|
|
58
58
|
};
|
|
@@ -23,7 +23,7 @@ export interface VideoPlayerStageProps {
|
|
|
23
23
|
* handle + event callbacks (via `usePlayer`), then renders the composed v10 skin
|
|
24
24
|
* ({@link GclickVideoSkin}) wrapping the credentialed `<HlsJsVideo>`. The skin owns
|
|
25
25
|
* the chrome — controls, layout, poster and the fullscreen target — and swaps the
|
|
26
|
-
* seek bar ↔
|
|
26
|
+
* seek bar ↔ live button by `isLive`; we only wrap it to size and flatten
|
|
27
27
|
* the frame.
|
|
28
28
|
*/
|
|
29
29
|
export declare function VideoPlayerStage({ src, poster, variant, suspended, optionalControls, className, controlRef, onReady, onPlay, onPause, onEnded, onWaiting, onError, onAccessError, onDurationChange, }: VideoPlayerStageProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPlayerStage.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/VideoPlayerStage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAqBlD,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACvD,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAChE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,MAAM,EACN,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,OAAO,EACP,aAAa,EACb,gBAAgB,GACjB,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"VideoPlayerStage.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/VideoPlayerStage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAqBlD,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACvD,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAChE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,MAAM,EACN,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,OAAO,EACP,aAAa,EACb,gBAAgB,GACjB,EAAE,qBAAqB,oDAsEvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { selectStreamType as
|
|
2
|
+
import { useRef as g, useMemo as a } from "react";
|
|
3
|
+
import { selectStreamType as h } from "@videojs/react";
|
|
4
4
|
import { HlsJsVideo as A } from "@videojs/react/media/hlsjs-video";
|
|
5
5
|
import { HLS_CROSS_ORIGIN as C, HLS_PREFER_PLAYBACK as O } from "../constants.js";
|
|
6
6
|
import { createAccessErrorXhrObserver as V } from "../hlsAccessErrors.js";
|
|
@@ -18,8 +18,8 @@ function se({
|
|
|
18
18
|
src: t,
|
|
19
19
|
poster: c,
|
|
20
20
|
variant: s,
|
|
21
|
-
suspended:
|
|
22
|
-
optionalControls:
|
|
21
|
+
suspended: u,
|
|
22
|
+
optionalControls: p,
|
|
23
23
|
className: f,
|
|
24
24
|
controlRef: d,
|
|
25
25
|
onReady: y,
|
|
@@ -27,22 +27,22 @@ function se({
|
|
|
27
27
|
onPause: P,
|
|
28
28
|
onEnded: R,
|
|
29
29
|
onWaiting: v,
|
|
30
|
-
onError:
|
|
31
|
-
onAccessError:
|
|
32
|
-
onDurationChange:
|
|
30
|
+
onError: b,
|
|
31
|
+
onAccessError: E,
|
|
32
|
+
onDurationChange: k
|
|
33
33
|
}) {
|
|
34
|
-
const e = n.usePlayer(),
|
|
34
|
+
const e = n.usePlayer(), H = n.usePlayer(h), i = G(H?.streamType, e.state.duration), r = g(null), m = M(E, r), l = a(() => _(V(m)), [m]), I = a(() => x(t, O, l), [t, l]);
|
|
35
35
|
w(d, e, r), B(e, {
|
|
36
36
|
onPlay: S,
|
|
37
37
|
onPause: P,
|
|
38
38
|
onEnded: R,
|
|
39
39
|
onWaiting: v,
|
|
40
|
-
onError:
|
|
41
|
-
onDurationChange:
|
|
40
|
+
onError: b,
|
|
41
|
+
onDurationChange: k
|
|
42
42
|
});
|
|
43
|
-
const
|
|
43
|
+
const L = j(e, u);
|
|
44
44
|
return T(r, () => {
|
|
45
|
-
y?.(),
|
|
45
|
+
y?.(), L();
|
|
46
46
|
}), /* @__PURE__ */ o(
|
|
47
47
|
F,
|
|
48
48
|
{
|
|
@@ -55,16 +55,17 @@ function se({
|
|
|
55
55
|
poster: c,
|
|
56
56
|
isLive: i,
|
|
57
57
|
variant: s,
|
|
58
|
-
optionalControls:
|
|
58
|
+
optionalControls: p,
|
|
59
59
|
children: /* @__PURE__ */ o(
|
|
60
60
|
A,
|
|
61
61
|
{
|
|
62
62
|
ref: r,
|
|
63
|
-
source:
|
|
63
|
+
source: I,
|
|
64
64
|
crossOrigin: C,
|
|
65
65
|
autoPlay: !0,
|
|
66
66
|
muted: !0,
|
|
67
|
-
playsInline: !0
|
|
67
|
+
playsInline: !0,
|
|
68
|
+
fallback: null
|
|
68
69
|
}
|
|
69
70
|
)
|
|
70
71
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LiveButtonProps } from '@videojs/react';
|
|
3
|
+
/**
|
|
4
|
+
* The vendor's `LiveButton` (`@videojs/react/dist/dev/ui/live-button/component.js`),
|
|
5
|
+
* subscribed to its derived state only: same core, element, attributes and
|
|
6
|
+
* text.
|
|
7
|
+
*
|
|
8
|
+
* The vendor selects the whole time slice (`component.js:32`), and since 10.1.0
|
|
9
|
+
* the store writes `currentTime` on every animation frame while playing
|
|
10
|
+
* (`@videojs/core/dist/dev/dom/store/features/time.js:58-69`), so that button
|
|
11
|
+
* re-renders every frame in every live tile. This one selects the core's state
|
|
12
|
+
* (`live`, `liveEdge`, `disabled`, `label`), which the core replaces only when
|
|
13
|
+
* one of them changes, and `usePlayer` keeps the previous result while the new
|
|
14
|
+
* one is shallow-equal. Activation reads the store when it happens, since the
|
|
15
|
+
* last render no longer holds the current time.
|
|
16
|
+
*
|
|
17
|
+
* Left out, because `LiveOrSeekButtons` uses none of it: `children`, `label`,
|
|
18
|
+
* `disabled`, `style`, passthrough props, the forwarded ref, the tooltip wiring
|
|
19
|
+
* (the live button has no tooltip, as in the vendor's live-video skin) and the
|
|
20
|
+
* missing-feature warning (the player always composes live, time and buffer).
|
|
21
|
+
* Retire it for the vendor's once that one selects derived state.
|
|
22
|
+
*/
|
|
23
|
+
export declare function LiveButton({ render, className }: Pick<LiveButtonProps, 'render' | 'className'>): ReactNode;
|
|
24
|
+
//# sourceMappingURL=LiveButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveButton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoPlayer/subcomponents/skin/LiveButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAQL,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAsBxB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG,SAAS,CA4C1G"}
|