• Stars
    star
    210
  • Rank 180,693 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

QMediaPlayer for Quasar

QMediaPlayer (Vue Plugin, UMD and Quasar App Extension)

@quasar/quasar-ui-qmediaplayer @quasar/quasar-app-extension-qmediaplayer GitHub code size in bytes GitHub repo size in bytes

If you are looking for QMediaPlayer v2.+ (with Quasar v2/Vue v3 support) look into the next branch. For v2.+ documentation, go here.

Structure

  • /ui - standalone npm package (go here for more information)
  • /app-extension - Quasar app extension
  • /demo - docs, demo and examples project
  • live demo - live docs, demo and examples

Demo Workflow

If you fork or download this project, make sure you have the Quasar CLI globally installed:

$ npm i -g @quasar/cli

The workflow to build the demo, on a fresh project, is as follows:

$ cd ui
$ yarn
$ yarn build
$ cd ../demo
$ yarn
$ quasar dev

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.

Completed languages

Example Code

Video example

<q-media-player
  type="video"
  background-color="black"
  :muted="muted"
  radius="1rem"
  :autoplay="true"
  :show-big-play-button="true"
  :sources="video.sources"
  :poster="video.poster"
  :tracks="video.tracks"
  track-language="English"
  @ended="onEnded"
>
  <template v-if="overlay" v-slot:overlay>
    <div>
      <img
        src="quasar-logo.png"
        style="width: 30vw; max-width: 50px; opacity: 0.25;"
      >
    </div>
  </template>
</q-media-player>

and the data...

data () {
  return {
    video: {
      label: 'Tears of Steel',
      poster: 'media/TearsOfSteel/TearsOfSteel.jpeg',
      sources: [
        {
          src: 'http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/tears_of_steel_720p.mov',
          type: 'video/mp4'
        }
      ],
      tracks: [
        {
          src: 'media/TearsOfSteel/TOS-en.vtt',
          kind: 'subtitles',
          srclang: 'en',
          label: 'English'
        },
        {
          src: 'media/TearsOfSteel/TOS-de.vtt',
          kind: 'subtitles',
          srclang: 'de',
          label: 'German'
        },
        {
          src: 'media/TearsOfSteel/TOS-es.vtt',
          kind: 'subtitles',
          srclang: 'es',
          label: 'Spanish'
        },
        {
          src: 'media/TearsOfSteel/TOS-fr-Goofy.vtt',
          kind: 'subtitles',
          srclang: 'fr',
          label: 'French'
        },
        {
          src: 'media/TearsOfSteel/TOS-it.vtt',
          kind: 'subtitles',
          srclang: 'it',
          label: 'Italian'
        },
        {
          src: 'media/TearsOfSteel/TOS-nl.vtt',
          kind: 'subtitles',
          srclang: 'nl',
          label: 'Dutch'
        }
      ]
    }
  }
}

Audio example

audio: {
  sources: [
    {
      src: 'https://raw.githubusercontent.com/quasarframework/quasar-ui-qmediaplayer/dev/demo/public/media/Scott_Holmes_-_04_-_Upbeat_Party.mp3',
      type: 'audio/mp3'
    }
  ]
}

Other

Fullscreen

It is important to note that if you desire fullscreen, then you must add Quasar's AppFullscreen plug-in to your quasar.conf.js. For more information, please refer to the documentation:

// quasar.conf.js

return {
  framework: {
    plugins: [
      'AppFullscreen'
    ]
  }
}

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.

For more detailed information go here.

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.

For more detailed information go here.

networkState

You can capture the networkState with the @networkState event.

  NETWORK_EMPTY = 0
  NETWORK_IDLE = 1
  NETWORK_LOADING = 2
  NETWORK_NO_SOURCE = 3

For more detailed information go here.

MediaError

You can capture the MediaError with the @error event.

  MEDIA_ERR_ABORTED = 1
  MEDIA_ERR_NETWORK = 2
  MEDIA_ERR_DECODE = 3
  MEDIA_ERR_SRC_NOT_SUPPORTED = 4

For more detailed information go here.

iOS

If you want to use the playsinline property with iOS, you will need to add the following to the config.xml for your iOS build:

<preference name="AllowInlineMediaPlayback" value="true" />

Direct Access

If you find you have a need access to the underlying media player, you can set up a ref on QMediaPlayer and access $media directly, even capturing and handling your own events.

  <q-media-player
    ref="myPlayer"
    ...
  />

then

// in code some where
this.$refs.myPlayer.$media

// examples to call native functions directly:
// this.$refs.myPlayer.$media.pause()
// this.$refs.myPlayer.$media.play()

// or via QMediaPlayer
// this.$refs.myPlayer.pause()
// this.$refs.myPlayer.play()

Donate

If you appreciate the work that went into this, please consider donating to Quasar or Jeff.

License

MIT (c) Jeff Galbraith [email protected]

More Repositories

1

quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
JavaScript
25,088
star
2

quasar-awesome

🎉 A list of awesome things related to Quasar
1,683
star
3

quasar-ui-qcalendar

QCalendar - Quasar App Extension, Vue CLI plug-in and UMD distributions available
Vue
408
star
4

quasar-play

[<= 0.17] Quasar Framework Showcase App
Vue
317
star
5

quasar-cli

[DEPRECATED, <= 0.17) Quasar Framework - CLI
JavaScript
204
star
6

icongenie

CLI tool to generate all the icons and splashscreens for your Quasar Apps
JavaScript
181
star
7

quasar-testing

Testing Harness App Extensions for the Quasar Framework 2.0+
TypeScript
172
star
8

quasar-ui-qmarkdown

A Quasar UI App Extension to display inline markdown
JavaScript
151
star
9

quasar-framework.org

[DEPRECATED, v0.17] Quasar Framework - The Official Website
HTML
110
star
10

app-extension-apollo

The official Quasar App-Extension for Apollo and GraphQL - Currently Beta!
JavaScript
107
star
11

quasar-starter-kit

Quasar CLI Starter Kit
JavaScript
107
star
12

app-extension-qpdfviewer

View PDF documents in your Quasar app
JavaScript
97
star
13

app-extension-dotenv

Official Quasar App Extension for dotenv
JavaScript
71
star
14

vue-cli-plugin-quasar

Quasar Framework Vue CLI plugin
JavaScript
68
star
15

firebase-sample-apps

Quasar sample apps for Firebase integration.
JavaScript
67
star
16

quasar-ui-qiconpicker

QIconPicker - Quasar App Extension
JavaScript
56
star
17

quasar-nuxt

[TEMPORARILY DISCONTINUED] Nuxt module for Quasar Framework
Vue
56
star
18

quasar-ui-qwindow

QWindow - Floating, moveable, resizable windows
JavaScript
53
star
19

quasar-template-meteor

Quasar Starter Kit for Meteor
Vue
50
star
20

app-extension-typescript

Add TypeScript to your existing Quasar 1.0 JS project
JavaScript
50
star
21

app-extension-qenv

Load targeted variables into your quasar project
JavaScript
50
star
22

quasar-ui-qactivity

Create activity timeline
JavaScript
45
star
23

quasar-ui-qribbon

A Ribbon component for Quasar Framework v1.0
JavaScript
45
star
24

quasar-template-pwa

[DEPRECATED] Quasar PWA Boilerplate / Starter kit
JavaScript
43
star
25

quasar-template-default

[DEPRECATED] Quasar App Boilerplate / Starter kit
JavaScript
41
star
26

quasar-ui-qflashcard

QFlashcard component for Quasar
JavaScript
40
star
27

quasar-ui-qscroller

QScroller - App Extension, Vue CLI and UMD for Quasar
JavaScript
36
star
28

quasar-extras

[DEPRECATED, <= 0.17, moved to main repo] Fonts, icons and animations for Quasar Framework
CSS
32
star
29

quasar-ui-qoverlay

Overlays simplified
JavaScript
31
star
30

quasar-art

Quasar Framework Artworks
SCSS
30
star
31

app-extension-qzoom

Zoom any content (image, video, text, components, ...)
JavaScript
28
star
32

quasar-wrapper-feathersjs-api

[DEPRECATED] Quasar Framework Feathersjs API Wrapper
JavaScript
28
star
33

quasar-hackernews

HackerNews clone built with Vue 2.0, vue-router & vuex & Quasar Framework, with server-side rendering
JavaScript
25
star
34

rfcs

RFCs for Quasar Framework
17
star
35

electron-wrapper

[DEPRECATED] Electron Wrapper for Quasar App
JavaScript
17
star
36

app-extension-examples

Examples of basic Quasar App Extensions
JavaScript
17
star
37

quasar-starter-kit-umd

Quasar UMD/standalone example
HTML
16
star
38

app-extension-qplaceholder

QPlaceholder - Add a placeholder while your data is being retrieved from the server.
JavaScript
16
star
39

quasar-starter-kit-app-extension

Quasar Framework starter kit for creating App Extensions
JavaScript
14
star
40

quasar-wrapper-graphql-api

[DEPRECATED] Quasar Framework GraphQL API Wrapper
JavaScript
11
star
41

eslint-plugin-quasar

Quasar Framework plugin for ESLint
JavaScript
11
star
42

quasar-starter-kit-ui

Quasar Framework UI Template
JavaScript
10
star
43

quasar-codesandbox

A Codesandbox Template
JavaScript
10
star
44

quasar-wrapper-express-api

[DEPRECATED] Quasar Framework Express API Wrapper
JavaScript
9
star
45

app-extension-universal-fs

[WIP] @quasar/universal-fs Quasar App Extension
JavaScript
9
star
46

app-extension-feathersjs

[WIP] The official Quasar 1.0 App-Extension for feathersjs
JavaScript
6
star
47

app-extension-wizard

[DISCONTINUED] The wizard collects common App Extensions and lets you install a group and choose individual ones.
JavaScript
5
star
48

new-issue.quasar.dev

WIP - Handling new issue reporting for Quasar Github account
JavaScript
4
star
49

cdn

Quasar Framework CDN
3
star
50

app-extension-obyte

An app extension for integrating obyte.js into a Quasar 1.0 Project
JavaScript
2
star
51

legacy-create

The legacy "quasar create" command into its own CLI
JavaScript
2
star
52

dist-v0-16.quasar-framework.org

Distributable for v0-16.quasarframework.org
HTML
1
star
53

dist-v0-13.quasar-framework.org

Distributable for v0-13.quasarframework.org
HTML
1
star