Socket
Socket
Sign inDemoInstall

@quasar/quasar-app-extension-qmediaplayer

Package Overview
Dependencies
0
Maintainers
4
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @quasar/quasar-app-extension-qmediaplayer

QMediaPlayer is an app extension for Quasar


Version published
Weekly downloads
319
decreased by-47.19%
Maintainers
4
Install size
97.8 kB
Created
Weekly downloads
 

Readme

Source

QMediaPlayer

QMediaPlayer is an app extension for Quasar Framework v1. It will not work with legacy versions of Quasar Framework.

This work is currently in alpha and there are expected changes while things get worked out.

WARNING

This app extension has been updated to work with changes that were released with @quasar/app - 1.0.0-beta.9. If you have not upgraded to at least 1.0.0-beta.9 this app extension will not work.

If you have installed before @quasar/app - 1.0.0-beta.9 (or later) then follow these before upgrading Quasar if you previously had this extension installed:

  1. Remove: quasar ext -r @quasar/qmediaplayer
  2. Upgrade: yarn upgrade
  3. Re-install: quasar ext add @quasar/qmediaplayer

Installation

In your Quasar project:

quasar ext add @quasar/qmediaplayer

Test Project

Can be found here.

Demo

Can be found here.

Example Code

TBD

Language Files

We need help translating the language files. They are all currently using English. If you know another language, please PR and help us out.


QMediaPlayer Vue Properties

Vue PropertyTypeModeDescription
typeStringBoth['video','audio'] This determines the type of player. (Default: 'video')
colorStringBothOne from Quasar Color Palette. It determines the color of the MediaPlayer controls. (Default: 'white')
mobile-modeBooleanVideoIn normal mode, the controls show/hide with mouse movements. When set to true, the controls' visibility is controlled by touch/click. (Default: false)
sourcesArrayBothRequired. This is an array of one or more objects, that looks like this: { src: 'https://your-server/your-video.mov', type: 'video/mp4' }
posterStringVideoThe poster image to display before the video is started.
tracksArrayVideoThis is an array of one or more objects, that looks like this: { src: 'https://your-server//path-to-subtitles-en.vtt', kind: 'subtitles', srclang: 'en', label: 'English }
track-languageStringVideoA value that corresponds to the 'label' attribute of the 'tracks' property. This will be the default language.
preloadStringBoth['none', 'metadata', 'auto'] Provides a hint to the browser about what the author thinks will lead to the best user experience. (Default: 'metadata').
denseBooleanBothWhen true displays controls window on one line.
darkBooleanBothWhen component is rendered on a dark background.
autoplayBooleanBothAutomatically start video/audio when it is ready to play. (Default: false)
cross-originString,nullBoth[null, 'anonymous', 'use-credentials']
volumeNumberBothA value from 0-100 (as a percentage). (Default: 60)
mutedBooleanBothIf the player should be muted. (Default: false)
show-big-play-buttonBooleanVideoShow/hide the Big Play Button. (Default: true)
show-spinnerBooleanBothIf the spinner should be displayed while video/audio is loading. (Default: true)
controls-display-timeNumberVideoThe amount of idle time in milliseconds to wait before hiding the controls (default 2000). This is applied when the mouse cursor is within the QMediaPlayer window but has not moved.
playback-ratesArrayVideoThis is an array of one or more objects, that look like this: { label: '.5x', value: 0.5 }. Note: The default playbackRates include 0.5, 1, 1.5 and 2.0."
playback-rateNumberVideoCorresponds to the value in playback-rates.
background-colorStringBothOne from Quasar Color Palette. It determines the background color of the MediaPlayer. (Default: 'black')

cross-origin:

Whether to use CORS for fetching assets.

  1. anonymous - CORS requests for this element will not have the credentials flag set.
  2. use-credentials - CORS requests for this element will have the credentials flag set; this means the request will provide credentials.
  3. null - do not use CORS.

preload:

This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience. It may have one of the following values:

  1. none: Indicates that the audio should not be preloaded.
  2. metadata: Indicates that only audio metadata (e.g. length) is fetched.
  3. auto: Indicates that the whole audio file can be downloaded, even if the user is not expected to use it.

QMediaPlayer Vue Methods

Vue MethodModeDescription
showControls()VideoShow the controls.
hideControls()VideoHide the controls.
toggleControls()VideoToggle the controls.
togglePlay()BothToggles between play/pause states.
toggleMuted()BothToggles between mute/unmute states..
toggleFullscreen()VideoToggle fullscreen mode.
setCurrentTime(seconds)BothSet the current time of the video/audio player (in seconds).
setVolume(percent)BothSets the volume as a percent (0-100).

QMediaPlayer Vue Events

Vue EventModeDescription
@loaded()BothEmitted when the media has been loaded.
@ready()BothEmitted when the media is ready to play. You cannot play/pause or setCurrentTime before this event.
@duration(seconds)BothEmitted when the duration of the media has been determined.
@ended()BothEmitted when the media has finished playing.
@error(MediaError)BothEmitted when there is a media error.
@paused()BothEmitted when the media is paused.
@playing()BothEmitted when the media starts playing. This will also emit after a pause or a wait.
@timeupdate(curTime, remaining)BothEmitted wenever there is a time update (during play).
@fullscreen(true/false)VideoEmitted when entering/exiting fullscreen mode.
@waiting()BothEmitted when the media player goes into a wait state (typically waiting while downloading)
@showControls(true/false)VideoEmitted when the Controls are toggled (show/hide).
@volume(percent)BothEmitted when the volume changes.
@muted(true/false)BothEmitted when the mute changes.

QMediaPlayer Vue Slots

Vue SlotsModeDescription
old-browserBothWhen the browser does not support HTML5 (or has Javascript turned off).
overlayBothUsed to overlay any HTML over the media window.
error-windowBothUsed to display an error.
controlsBothWith this slot all of the controls can be replaced.
spinnerBothWith this slot the loading spinner can be replaced.
big-play-buttonVideoWith this slot the Big Play Button can be replaced.
display-timeBothWith this slot the display time can be replaced.
position-sliderBothWith this slot the positioning slider can be replaced.
duration-timeBothWith this slot the duration time can be replaced.
playBothWith this slot the play button can be replaced.
volumeBothWith this slot the volume mute/unmute button can be replaced.
volume-sliderBothWith this slot the volume slider can be replaced.
settingsVideoWith this slot the Settings icon can be replaced.
settings-menuVideoWith this slot the Settings Menu can be replaced.
fullscreenVideoWith this slot the Fullscreen icon can be replaced.

Keywords

FAQs

Last updated on 02 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc