@f8team/reel-core 1.1.2 → 1.1.4

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
@@ -1,5 +1,17 @@
1
1
  # @f8team/reel-core
2
2
 
3
+ ## 1.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 8a6c787: HLS: automatic quality selection now stops at the smallest rendition whose width or height reaches the player's larger on-screen side times devicePixelRatio (hls.js `capLevelToPlayerSize`), so a small player on a modest PC is no longer moved to the highest rendition (for example 1440p) within a second. Players that are large in device pixels (for example 960 CSS px or wider at devicePixelRatio 2) still get the top rendition. A rendition picked by hand in the quality menu is never capped.
8
+
9
+ ## 1.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 01e3f6a: Fullscreen on iPhone: where the element Fullscreen API is missing, `fullscreen:toggle` now expands the player container to cover the window (overlays such as the watermark stay visible) instead of doing nothing. Escape or a second toggle restores the page. The container gets `data-reel-window-fullscreen` and `state.fullscreen` follows it.
14
+
3
15
  ## 1.1.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -473,6 +473,7 @@ var HlsLoader = class {
473
473
  attachWithHlsJs(Hls, video, source) {
474
474
  const hls = new Hls({
475
475
  enableWorker: true,
476
+ capLevelToPlayerSize: this.options.capLevelToPlayerSize ?? true,
476
477
  ...makeHlsLoadPolicies(),
477
478
  xhrSetup: (xhr, url) => this.installXhrWatcher(xhr, url, source)
478
479
  });
@@ -1476,6 +1477,8 @@ function createStore(initial, options = {}) {
1476
1477
  }
1477
1478
 
1478
1479
  // src/createPlayer.ts
1480
+ var WINDOW_FULLSCREEN_ATTR = "data-reel-window-fullscreen";
1481
+ var WINDOW_FULLSCREEN_EVENT = "reel-windowfullscreenchange";
1479
1482
  function makeInitialState(options) {
1480
1483
  return {
1481
1484
  status: "idle",
@@ -1914,13 +1917,15 @@ function createPlayer(options = {}, internal = {}) {
1914
1917
  });
1915
1918
  const ownerDocument = target.ownerDocument;
1916
1919
  const onFullscreenChange = () => {
1917
- const isFullscreen = !!ownerDocument.fullscreenElement?.contains(target);
1920
+ const isFullscreen = !!ownerDocument.fullscreenElement?.contains(target) || !!target.closest(`[${WINDOW_FULLSCREEN_ATTR}]`);
1918
1921
  store.setState({ fullscreen: isFullscreen });
1919
1922
  bus.emit("fullscreenchange", { fullscreen: isFullscreen });
1920
1923
  };
1921
1924
  ownerDocument.addEventListener("fullscreenchange", onFullscreenChange);
1925
+ target.addEventListener(WINDOW_FULLSCREEN_EVENT, onFullscreenChange);
1922
1926
  nativeListeners.push(
1923
- () => ownerDocument.removeEventListener("fullscreenchange", onFullscreenChange)
1927
+ () => ownerDocument.removeEventListener("fullscreenchange", onFullscreenChange),
1928
+ () => target.removeEventListener(WINDOW_FULLSCREEN_EVENT, onFullscreenChange)
1924
1929
  );
1925
1930
  }
1926
1931
  function unbindNativeEvents() {