@f8team/reel-core 1.1.2 → 1.1.3

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,11 @@
1
1
  # @f8team/reel-core
2
2
 
3
+ ## 1.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 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.
8
+
3
9
  ## 1.1.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1476,6 +1476,8 @@ function createStore(initial, options = {}) {
1476
1476
  }
1477
1477
 
1478
1478
  // src/createPlayer.ts
1479
+ var WINDOW_FULLSCREEN_ATTR = "data-reel-window-fullscreen";
1480
+ var WINDOW_FULLSCREEN_EVENT = "reel-windowfullscreenchange";
1479
1481
  function makeInitialState(options) {
1480
1482
  return {
1481
1483
  status: "idle",
@@ -1914,13 +1916,15 @@ function createPlayer(options = {}, internal = {}) {
1914
1916
  });
1915
1917
  const ownerDocument = target.ownerDocument;
1916
1918
  const onFullscreenChange = () => {
1917
- const isFullscreen = !!ownerDocument.fullscreenElement?.contains(target);
1919
+ const isFullscreen = !!ownerDocument.fullscreenElement?.contains(target) || !!target.closest(`[${WINDOW_FULLSCREEN_ATTR}]`);
1918
1920
  store.setState({ fullscreen: isFullscreen });
1919
1921
  bus.emit("fullscreenchange", { fullscreen: isFullscreen });
1920
1922
  };
1921
1923
  ownerDocument.addEventListener("fullscreenchange", onFullscreenChange);
1924
+ target.addEventListener(WINDOW_FULLSCREEN_EVENT, onFullscreenChange);
1922
1925
  nativeListeners.push(
1923
- () => ownerDocument.removeEventListener("fullscreenchange", onFullscreenChange)
1926
+ () => ownerDocument.removeEventListener("fullscreenchange", onFullscreenChange),
1927
+ () => target.removeEventListener(WINDOW_FULLSCREEN_EVENT, onFullscreenChange)
1924
1928
  );
1925
1929
  }
1926
1930
  function unbindNativeEvents() {