Using QMediaPlayer

QMediaPlayer gives Quasar apps a consistent audio and video player experience without forcing you back to browser-default media controls. Start with a source list, then layer in colors, captions, poster images, dense layouts, custom icon sets, or language packs as the UI needs them.

Music courtesy of Free Music Archive. Videos and subtitles courtesy of Blender Foundation and Tears of Steel.

WARNING

Some example videos are remotely hosted and may load slowly or fail depending on your network location.

Need adaptive streaming adapters, runtime blobs, custom language or icon sets, overlays, or deeper styling hooks? See the Advanced page after the basics here.

API

Loading QMediaPlayer API...

Basic Playback

Start with type and either source or sources. Audio and video share the same component API, so switching between media types usually means changing the source data rather than rebuilding the UI.

Audio Basic


Video Basic


Auto Pause

Use auto-pause when videos live inside long documentation pages, feeds, dashboards, or galleries where playback should stop once the player is no longer visible. QMediaPlayer pauses when the component is completely outside the viewport and intentionally does not auto-resume.

Video Auto Pause


Color

Use color props to align the player with your design system. The big play button can be customized separately, which is useful when the video poster needs a stronger call to action.

Audio Color


Video Color


Video Big Play Button Color


Background Color

Background colors help audio players feel intentional in cards, drawers, and hero sections where there is no video poster to carry the visual design.

Audio Background Color


Video Background Color


Poster

Poster images are useful for setting context before playback starts, especially when videos appear in content-heavy pages. Use fallback-poster when you want a reusable default image while still letting an explicit poster take precedence.

Video Poster


Video Fallback Poster


Native audio elements do not support poster images. When audio needs artwork, use the video player mode with an audio source.

Audio With Poster


Dark

Dark mode variants let media sit naturally inside dashboards, video galleries, or dark-themed documentation pages.

Audio Dark


Video Dark


Dense

Dense controls are a good fit for compact cards, sidebars, and other constrained layouts.

Audio Dense


Video Dense


Audio Without Video

By default, QMediaPlayer can use the video element for audio playback. If that causes platform-specific issues, use no-video to force an audio element.

Audio No Video


Volume Controls

Hide the volume slider when space is tight or when volume should be managed elsewhere in the application.

Audio Hide Volume Slider


Video Hide Volume Slider


Audio Hide Volume Slider Dense


Video Hide Volume Slider Dense


Disabled Seek

Disable seeking when the media experience should be linear, such as training content, onboarding videos, or guided audio.

Audio Disabled Seek


Video Disabled Seek


Bottom Controls

Bottom controls keep actions predictable for larger videos and layouts where overlay controls would fight with the media content.

TIP

You do not have to use type="audio" to play audio. The type="video" mode can also play audio sources.

Audio Bottom Controls


Video Bottom Controls


Portrait And Mobile

QMediaPlayer supports portrait media and mobile-friendly controls. mobile-mode turns off the hover-driven controls window so tapping the video toggles the controls display.

Video Portrait


Video Mobile Mode


Sources

Use source for a single source or sources when the browser should choose from multiple formats.

Audio Source


Video Source


Tracks

Tracks are captions or subtitles. Start playback, then use the options menu to choose a language track.

Video Tracks


In the example below, the default language track is French.

Video Tracks Language


For adaptive streaming, runtime files, overlays, icon sets, localization, and deeper styling, continue with the Advanced page.