FrameworkStyle

media-fullscreen-button

A button component for entering and exiting fullscreen mode

Anatomy

<media-fullscreen-button></media-fullscreen-button>

Behavior

Toggles fullscreen mode. Detects platform support through availability — when fullscreen is "unsupported", the toggle does nothing.

Styling

You can style the button based on fullscreen state:

/* In fullscreen */
media-fullscreen-button[data-fullscreen] {
  background: red;
}

Consider hiding the button when unsupported:

media-fullscreen-button[data-availability="unsupported"] {
  display: none;
}

Accessibility

Renders a <button> with an automatic aria-label: “Enter fullscreen” or “Exit fullscreen”. Override with the label prop. Keyboard activation: Enter / Space.

Examples

Basic Usage

Exit Fullscreen Fullscreen
<video-player class="html-fullscreen-button-basic">
    <video
        src="https://stream.mux.com/lhnU49l1VGi3zrTAZhDm9LUUxSjpaPW9BL4jY25Kwo4/highest.mp4"
        autoplay
        muted
        playsinline
        loop
    ></video>
    <media-fullscreen-button class="html-fullscreen-button-basic__button">
        <span class="show-when-fullscreen">Exit Fullscreen</span>
        <span class="show-when-not-fullscreen">Fullscreen</span>
    </media-fullscreen-button>
</video-player>

API Reference

Props

Prop Type Default
disabled boolean false
label string | function ''

State

State is reflected as data attributes for CSS styling.

Property Type
availability 'available' | 'unavailable' | 'unsupported'
fullscreen boolean

Data attributes

Attribute Description
data-fullscreen Present when fullscreen mode is active.
data-availability Indicates fullscreen availability (available or unsupported).
VideoJS