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>
| Param | Type | Default | Description |
|---|---|---|---|
| options | Object | ||
| options.src | string | Video URL (required). | |
| [options.poster] | string | Optional poster image URL. | |
| [options.controls] | boolean | true | Show native player controls. |
| [options.muted] | boolean | true | Start muted. |
| [options.autoplay] | boolean | false | Autoplay on insert (browsers only honour this when also muted). |
| [options.loop] | boolean | false | |
| [options.preload] | string | ""metadata"" | One of "none", "metadata", "auto". Use "auto" when you want the bytes to fetch in the background after the poster paints. |
| [options.className] | string | Extra 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.
| Param | Type | Description |
|---|---|---|
| srcElement | HTMLElement | jQuery | Element the lightbox should expand from / contract back to. Used only for the source rect; not modified. |
| options | Object | See createPlayer's options; additionally honours all the same player flags. src required. |