@markdy/core 1.4.15 → 1.4.16
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/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -614,8 +614,11 @@ function resolvePlayer(config = {}, overrides = {}) {
|
|
|
614
614
|
const chrome = config.chrome ?? {};
|
|
615
615
|
const controlsAllowed = overrides.controls !== false;
|
|
616
616
|
const hostControlDefault = overrides.controls === true;
|
|
617
|
-
const
|
|
618
|
-
|
|
617
|
+
const controlsExplicitlyDeclared = Boolean(
|
|
618
|
+
config.controls && Object.keys(config.controls).length > 0 || overrideControls && Object.keys(overrideControls).length > 0
|
|
619
|
+
);
|
|
620
|
+
const unconfiguredFallback = controlsExplicitlyDeclared ? false : hostControlDefault;
|
|
621
|
+
const resolveControl = (value, fallback = unconfiguredFallback) => controlsAllowed && (value ?? fallback);
|
|
619
622
|
const requestedControls = {
|
|
620
623
|
seek: resolveControl(configuredControls.seek, false),
|
|
621
624
|
speed: resolveControl(configuredControls.speed),
|
|
@@ -626,7 +629,7 @@ function resolvePlayer(config = {}, overrides = {}) {
|
|
|
626
629
|
gif: resolveControl(configuredControls.gif),
|
|
627
630
|
share: resolveControl(configuredControls.share),
|
|
628
631
|
code: resolveControl(configuredControls.code, false),
|
|
629
|
-
theme: resolveControl(configuredControls.theme
|
|
632
|
+
theme: resolveControl(configuredControls.theme)
|
|
630
633
|
};
|
|
631
634
|
const hasExplicitInteraction = config.interaction !== void 0;
|
|
632
635
|
const fallbackGesture = overrides.interactiveViewport === true || overrides.controls === true;
|
package/package.json
CHANGED