Skip to main content

VideoPlayer

Import :

const VideoPlayer = brackets.getModule("view/VideoPlayer")

Strings

Tiny shared HTML5 <video> widget. Two entry points:

createPlayer(options) — returns a configured <video> wrapper the caller can drop anywhere in their UI.

renderFullScreenPlayer(srcElement, options) — opens a viewport- covering overlay with a large auto-playing player that expands out of srcElement (genie-style) and contracts back on close. Useful when an inline thumbnail should expand into a focused fullscreen view on click.

Kind: global constant

createPlayer(options) ⇒ jQuery

Build a <video> element wrapped in a div with sensible Phoenix defaults. Returns the wrapper as a jQuery object; the caller appends and disposes it.

Kind: global function
Returns: jQuery - <div class="phx-video-player ..."><video.../></div>

ParamTypeDefaultDescription
optionsObject
options.srcstringVideo URL (required).
[options.poster]stringOptional poster image URL.
[options.controls]booleantrueShow native player controls.
[options.muted]booleantrueStart muted.
[options.autoplay]booleanfalseAutoplay on insert (browsers only honour this when also muted).
[options.loop]booleanfalse
[options.preload]string"&quot;metadata&quot;"One of "none", "metadata", "auto". Use "auto" when you want the bytes to fetch in the background after the poster paints.
[options.className]stringExtra class on the wrapper.

renderFullScreenPlayer(srcElement, options) ⇒ Object

Open a viewport-covering overlay with a large autoplaying video that expands out of srcElement (Mac-dock-genie style) and contracts back to it on close. Click on the dimmed backdrop, the close (×) button, or pressing Escape closes the overlay.

Defaults: muted, autoplay, controls, preload="auto" (so the bytes stream while the open animation runs and the user can hit play straight away). Override via options.

Kind: global function
Returns: Object - Handle exposing a programmatic close.

ParamTypeDescription
srcElementHTMLElement | jQueryElement the lightbox should expand from / contract back to. Used only for the source rect; not modified.
optionsObjectSee createPlayer's options; additionally honours all the same player flags. src required.