Liking cljdoc? Tell your friends :D

dk.simongray.play-nice.display.fullscreen

Fullscreen of a player, with the fallback that an iPhone needs, where only a video element itself can go fullscreen, in the system's own player.

The functions take these opts:

  • :video, the video element of the player, for that fallback

    (-> (enter! player {:video video :orientation :landscape}) (.then #(swap! page assoc :fullscreen %))) ;; {:fullscreen :element :orientation {:refused :not-supported}} ;; on a desktop, or {:fullscreen :video …} on an iPhone

Fullscreen of a player, with the fallback that an iPhone needs, where
only a video element itself can go fullscreen, in the system's own
player.

The functions take these opts:

- :video, the video element of the player, for that fallback

    (-> (enter! player {:video video :orientation :landscape})
        (.then #(swap! page assoc :fullscreen %)))
    ;; {:fullscreen :element :orientation {:refused :not-supported}}
    ;; on a desktop, or {:fullscreen :video …} on an iPhone
raw docstring

enter!cljs

(enter! element)
(enter! element {:keys [video orientation] :as opts})

Put the element fullscreen, with the opts above and below, and return a promise of the answer, which never rejects:

  • {:fullscreen :element} once the element is fullscreen
  • {:fullscreen :video} where only the video can be, e.g. on an iPhone
  • {:refused :not-allowed} without a click, or where the page may not, e.g. in an iframe whose allow attribute leaves out fullscreen
  • {:refused :no-metadata} for a video without its metadata yet, which an iPhone can't show in its player
  • {:refused :not-supported} where neither can go fullscreen

The options:

  • :orientation, e.g. :landscape, to lock the screen in once fullscreen, whose answer from lock-orientation! the answer holds as :orientation

Call it in a click handler, since every engine refuses it otherwise.

Put the `element` fullscreen, with the `opts` above and below, and
return a promise of the answer, which never rejects:

- {:fullscreen :element} once the element is fullscreen
- {:fullscreen :video} where only the video can be, e.g. on an iPhone
- {:refused :not-allowed} without a click, or where the page may not,
  e.g. in an iframe whose allow attribute leaves out fullscreen
- {:refused :no-metadata} for a video without its metadata yet, which an
  iPhone can't show in its player
- {:refused :not-supported} where neither can go fullscreen

The options:

- :orientation, e.g. :landscape, to lock the screen in once fullscreen,
  whose answer from lock-orientation! the answer holds as :orientation

Call it in a click handler, since every engine refuses it otherwise.
raw docstring

exit!cljs

(exit! element)
(exit! element {:keys [video] :as opts})

Leave the fullscreen of the element, with the opts above, and return a promise of its state afterwards, which never rejects, e.g. {:fullscreen false}.

In the iOS simulator, a video that has never played enters the system's player but can't leave it, which the state then shows as :video. Play the video in the tap that enters, as the player's own button does.

Leave the fullscreen of the `element`, with the `opts` above, and return
a promise of its state afterwards, which never rejects, e.g.
{:fullscreen false}.

In the iOS simulator, a video that has never played enters the system's
player but can't leave it, which the state then shows as :video. Play
the video in the tap that enters, as the player's own button does.
raw docstring

lock-orientation!cljs

(lock-orientation! orientation)

Lock the screen in the orientation, e.g. :landscape, and return a promise of the answer, which never rejects: {:locked :landscape}, or e.g. {:refused :not-supported} on a desktop. A browser locks the screen only while the page is fullscreen, and Firefox refuses it otherwise as {:refused :not-allowed}.

Lock the screen in the `orientation`, e.g. :landscape, and return a
promise of the answer, which never rejects: {:locked :landscape}, or
e.g. {:refused :not-supported} on a desktop. A browser locks the screen
only while the page is fullscreen, and Firefox refuses it otherwise as
{:refused :not-allowed}.
raw docstring

statecljs

(state element)
(state element {:keys [video] :as opts})

The fullscreen of the element, with the opts above, as a map of its :fullscreen: :element while the element is fullscreen, :video while its video is in the system's own player, and false otherwise.

The fullscreen of the `element`, with the `opts` above, as a map of its
:fullscreen: :element while the element is fullscreen, :video while its
video is in the system's own player, and false otherwise.
raw docstring

watch!cljs

(watch! element f)
(watch! element f {:keys [video] :as opts})

Call f with the state of the element now and whenever its fullscreen changes, with the opts above, and return a function that stops it, e.g. {:fullscreen :video}.

Call `f` with the state of the `element` now and whenever its fullscreen
changes, with the `opts` above, and return a function that stops it,
e.g. {:fullscreen :video}.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close