Giter Site home page Giter Site logo

core-player / vue-core-video-player Goto Github PK

View Code? Open in Web Editor NEW
462.0 11.0 77.0 70.38 MB

🍟 A Lightweight Video Player For Vue.js.

Home Page: https://core-player.github.io/vue-core-video-player/

JavaScript 34.81% Vue 62.04% HTML 0.76% Less 2.39%
video-player vue

vue-core-video-player's Introduction

vue-core-video-player

CircleCI prs welcome npm version npm downloads Twitter URL

A Lightweight Video Player For Vue.js.

Get Started

Npm

$ npm install vue-core-video-player --save

Yarn

$ yarn add vue-core-video-player --save
<template>
  <div class="player-container">
    <vue-core-video-player @play="your_method" src="./videos/your_video.mp4"></vue-core-video-player>
  </div>
<template>

<script>
import VueCoreVideoPlayer from 'vue-core-video-player'

Vue.use(VueCoreVideoPlayer)

</script>

View Demo

Docs

Features

  • Custom configuration
  • i18n
  • SSR
  • Picture-in-Picture Mode
  • Events Subscription
  • Development friendly
  • Mobile Adaptation

Who using it

Welcome to submit your website using the package Demo Case Collection

UI

Adobe XD

Behance

💐 Contributions

  • Open pull request with improvements
  • Discuss ideas in issues

vue-core-video-player's People

Contributors

dependabot[bot] avatar frodemmeling avatar jackpu avatar justineraze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-core-video-player's Issues

Cannot read property 'directive' of undefined In Vue3

After I import VueCoreVideoPlayer from yarn add use in vue3, it give me an error: Cannot read property 'directive' of undefined.

vue-core-video-player.common.js?42ab:5273 Uncaught TypeError: Cannot read property 'directive' of undefined
at Module.fb15 (vue-core-video-player.common.js?42ab:5273)
at webpack_require (vue-core-video-player.common.js?42ab:21)
at eval (vue-core-video-player.common.js?42ab:85)
at eval (vue-core-video-player.common.js?42ab:88)
at Object../node_modules/vue-core-video-player/dist/vue-core-video-player.common.js (chunk-vendors.js:3989)
at webpack_require (app.js:854)
at fn (app.js:151)
at eval (main.js:23)
at Module../src/main.js (app.js:1416)
at webpack_require (app.js:854)


【weekly】20190910-20191016

Code

  • Update volume settings play/pause time-span control;
  • Update cover progress layer;

Docs

Nothing updates.

UI

Nothing updates.

Support for vue 3?

I wanted to know if this project has support for vue 3 and if it does not currently have it, are you thinking of supporting it?

Add Mouse Inactivity

Please Add mouse inactivity so that the play button and other elements will hide.

Parameter Poster is incorrect

When the library creates the video adds a parameter Cover to the video HTML tag. In fact it should add the parameter poster='' to the tag. This is preventing the library from showing the covers for the videos.

如何在一个页面引入多个视频组件

如何在一个页面引入多个视频组件,并且多个组件之间相互不影响;现在引入多个后所有视频组件的属性用的都是最后引入的视频 组件的属性(例如视频时长...),点击所有视频的播放按钮时候,只播放最后一个视频的。请问什么方法能实现多个视频组件互不影响。

组件 name 不能设置为 switch

vue给出了以下提示:
Do not use built-in or reserved HTML elements as component id: switch
项目中有这么个组件 src/widgets/switch.vue

给src进行动态赋值

我令src='source', data里定义source: '', 尝试了多种方法后,src还是只能读取到data里面的空的source

【weekly】20190917-20191023

Code

  • Update logo loading Error layer
  • Add basic Video Events
  • Add Video Core mixins

Docs

Nothing updates.

UI

Update the project logo

fullscreen

When the player is full screen, control is hidden, but the mouse is still displayed
Or when playing, the mouse does not work all the time, can it be hidden

Multiple instances on the same page

Adding multiple instances with different video sources does not work. The video
always plays in the last instance on the page.

<vue-core-video-player :autoplay="false" :src="some_URL.mp4" /> <vue-core-video-player :autoplay="false" :src="some_other_URL.mp4" />

There should be some kind of key on each instance.

use urls in the src

URL support in src would be 🥧

<template>
  <div class="player-container">
    <vue-core-video-player src="https://www.youtube.com/watch?v=W3OIjQ5bkmQ"></vue-core-video-player>
  </div>
</template>
<script>
export default {
  name: "MultimediaComponent"
}
</script>

vue-core-video-player and i18n error

I use vue core video player and i18n plugin. When I try to use {{ $t('message') }}, I get the output

{ "dashboard": { "btn": { "play": "Play", "pause": "Pause", "fullscreen": "Full Screen", "exitFullscreen": "Exit Full Screen", "mute": "Mute", "unmute": "Unmute", "back": "Back", "pip": "Picture-in-Picture" }, "settings": { "autoplay": "Autoplay", "loop": "Loop", "speed": "Speed", "resolution": "Resolution" } }, "layers": { "error": { "2404": "Video Source Not Found", "2502": "Media Network Error", "2503": "Video Cannot DECODE", "2504": "Video Cannot Play!", "title": "(O_O)? Error!" }, "loading": { "msg": "Loading ..." } } }

But my "message": "hello world"

When I comment
import VueCoreVideoPlayer from 'vue-core-video-player'
Vue.use(VueCoreVideoPlayer), I see my message.

How can I use i18n plugin normally without uninstalling vue core video player?

ios无法正常播放

ios无法正常播放视频,文件太大时直接就出错,文件较小时,可以播放,但是不会动..

Fullscreen Issue

In full screen mode,
then press Esc button,
the screen is exit
but icon of full screen not change. ( still exit full screen)

image

Error when mounting: Uncaught TypeError: Cannot read property 'open' of undefined

The full error is:

Uncaught TypeError: Cannot read property 'open' of undefined
    at Object.<anonymous> (vue-core-video-player.common.js:7320)
    at Object.emit (vue-core-video-player.common.js:4156)
    at VueComponent.emit (vue-core-video-player.common.js:6511)
    at BaseVideoCore.emit (vue-core-video-player.common.js:6372)
    at vue-core-video-player.common.js:5954

FYI the current state of my view at the time is:

currentPanel = true
panelShow = false
speedListPanel = false
resolutionListPanel = false
resolution = '720p'
medias = ['string-to-my-mp4']
$container.classList = ['vcp-container', 'flex-grow-1']

After debugging I believe this is just a race condition or something in settings.vue:
https://github.com/core-player/vue-core-video-player/blob/master/src/dashboard/settings.vue

  mounted () {
    this.on(EVENTS.SOURCE_UPDATED, () => {
      this.medias = this.$player.medias
      this.resolution = this.$player.resolution
      const { autoplay, loop } = this.$player.config
      if (autoplay) {
        this.$refs['autoplaySwitch'].open() // <-------- Error happens here
      }
      if (loop) {
        this.$refs['loopSwitch'].open()
      }
    })
    document.addEventListener('click', () => {
      if (this.panelShow) {
        this.panelShow = false
        this.speedListPanel = false
        this.resolutionListPanel = false
        this.$container.classList.remove('settings-open')
      }
    })
  }

If I turn off autoplay the error goes away.

Maybe it is also possible the object hasn't been constructed yet because perhaps of the v-show='panelShow' in the template?

Also I am concerned about the document.addEventListener in this code snippet. It is added during mounting, but never removed during unmounting. This means event listeners are being leaked in my application.

Thanks again for the great video player.

_this5.start is not a function

Hi! Thanks for your nice package!
Unfortunately I get the error:

Uncaught TypeError: _this5.start is not a function at HTMLVideoElement.playFn (vue-core-video-player.common.js:6200)

Whenever I click play or switch between resolutions.
The video starts, the UI stays visible, Playbutton won't switch to Pausbutton.
I reinstalled the package, updated dependencies, updated vue, but the error remains.
What can be the issue here?

"export 'default' (imported as 'VueCoreVideoPlayer') was not found in 'vue-core-video-player'

When importing the VueCoreVideoPlayer, the console reports that there is no default export from the package. This is the code that I ran.

import Vue from 'vue'
import VueCoreVideoPlayer from 'vue-core-video-player'

Vue.use(VueCoreVideoPlayer)

Output
In terminal

"export 'default' (imported as 'VueCoreVideoPlayer') was not found in 'vue-core-video-player'

In browser

vue-core-video-player.common.js:6 Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
    at Module.eval (vue-core-video-player.common.js:6)
    at eval (vue-core-video-player.common.js:10551)
    at Module../node_modules/vue-core-video-player/dist/vue-core-video-player.common.js (vendors.app.js:9787)
    at __webpack_require__ (runtime.js:790)
 ...

vue 3.x

Uncaught TypeError: Cannot read property 'directive' of undefined

vue-core-video-player

PictureInPicture issue in some browsers

Hi, First of all, you did an amazing job whith this player ;)

I had an issue using PictureInPicture mode on Firefox on OSX: it did not works on your documentation. In the logs I have:

TypeError: "t.requestPictureInPicture is not a function"

I've checked my browsers on OSX
✅ Chrome
🔴 Safari
🔴 Firefox

FullScreen to restore with ESC button.

Steps to reproduce:

  1. Play the video inside a card.
  2. Click on FullScreen
  3. Press ESC button to restore.

Please find the attached screenshot.
Screen Shot 2020-07-03 at 6 50 52 PM

Sample Code:

<v-card :loading="loading" class="mx-auto my-12" max-width="374">
    <v-card-title>Cafe Badilico</v-card-title>

    <div class="player-container">
    <vue-core-video-player src="https://vsassets.netlify.app/vantashala.mp4"></vue-core-video-player>
  </div>

    <v-card-text>
      <v-row align="center" class="mx-0">
        <v-rating :value="4.5" color="amber" dense half-increments readonly size="14"></v-rating>
    </v-card-text>
    <v-card-actions>
      <v-btn color="deep-purple lighten-2" text @click="reserve">
        Reserve
      </v-btn>
    </v-card-actions>
  </v-card>

Not Supported vue3.0

Uncaught TypeError: Cannot read property 'directive' of undefined

vue-core-video-player

在弹窗中使用

当在element-ui的dialog组件内使用时,销毁dialog组件会导致播放器报错vue.runtime.esm.js:619 [Vue warn]: Error in beforeDestroy hook: "TypeError: function () {
src_instanceMap.delete(instance.VUE_DEVTOOLS_UID)
} is not a function"

found in

HSL not supported in nuxtjs project

Please help me. when enable ssr:false mode in nuxt.config.js file then player is ok . but when remove ssr:false in nuxt.config.js then player not working . how can i fix this please help me

Error when mounting: Uncaught TypeError: Cannot read property 'open' of undefined

Hi created an issue a couple months ago with this title, and linked here: #24

@JackPu replied and asked for more code the closed the issue. I replied with more code and never heard back, and the issue wasn't reactivated and lots of time has passed. Somebody else even chimed in and said they could reproduce. Because this is a real issue, and I would like to use this component, I am creating a new issue to raise awareness.

Note that version 0.18 and 0.19 made the problem much worse, and instead of getting just console errors now the entire player is crippled.

===== Comment from May 6 ====
Here I made a quick simplified app which demonstrates the problem. In this app, click Show, and everything is great in the console. Click Hide. Click Show again and the video plays but vue-core-video-player is spewing tons of stuff in the console. Before it was just the 'open' error. I have the video player in a modal dialog which is popped open based on what was clicked, so the video player is a sub-component of a large hierarchy. Here is the app:

<template>
  <div id="app">
    <button @click="show = !show">{{show ? 'Hide' : 'Show'}}</button>
    <vue-core-video-player :src="videoSource" :loop="false" v-if="show"></vue-core-video-player>
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
    return {
      show: false,
      videoSource: 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_1MB.mp4'
    };
  }
};
</script>

====== End Comment ====

====== Comment from May 5 =====
The full error is:

Uncaught TypeError: Cannot read property 'open' of undefined
    at Object.<anonymous> (vue-core-video-player.common.js:7320)
    at Object.emit (vue-core-video-player.common.js:4156)
    at VueComponent.emit (vue-core-video-player.common.js:6511)
    at BaseVideoCore.emit (vue-core-video-player.common.js:6372)
    at vue-core-video-player.common.js:5954

FYI the current state of my view at the time is:

currentPanel = true
panelShow = false
speedListPanel = false
resolutionListPanel = false
resolution = '720p'
medias = ['string-to-my-mp4']
$container.classList = ['vcp-container', 'flex-grow-1']

After debugging I believe this is just a race condition or something in settings.vue:
https://github.com/core-player/vue-core-video-player/blob/master/src/dashboard/settings.vue

  mounted () {
    this.on(EVENTS.SOURCE_UPDATED, () => {
      this.medias = this.$player.medias
      this.resolution = this.$player.resolution
      const { autoplay, loop } = this.$player.config
      if (autoplay) {
        this.$refs['autoplaySwitch'].open() // <-------- Error happens here
      }
      if (loop) {
        this.$refs['loopSwitch'].open()
      }
    })
    document.addEventListener('click', () => {
      if (this.panelShow) {
        this.panelShow = false
        this.speedListPanel = false
        this.resolutionListPanel = false
        this.$container.classList.remove('settings-open')
      }
    })
  }

If I turn off autoplay the error goes away.

Maybe it is also possible the object hasn't been constructed yet because perhaps of the v-show='panelShow' in the template?

Also I am concerned about the document.addEventListener in this code snippet. It is added during mounting, but never removed during unmounting. This means event listeners are being leaked in my application.

Thanks again for the great video player.
===== End Comment ====

[Feature Request] Video callback

Actually it's simple callback for some event like video end, pausing. I think it will make this package suitable for some application like e-learning.

vuetify not detecting it.

This dependency was not found:

  • vue-core-video-player in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vuetify-loader/lib/loader.js??ref--17-0!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/News/videos.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save vue-core-video-player

Play/Pause video when clicking anywhere on video

Current behaviour is that you have to click on big play/pause button to play and pause the video
but this is not good ux and its better to be able to play/pause with clicking anywhere on the video
also please make it so that you can hide the big button immedietly after pause/play
this will improve the ux greatly (youtube is a good example)

Provide an option to load component asynchronously

Currently we can only use this component when using as a vue plugin
Since the component is not exported, we cannot do something like this:

const getComponent = () => import('vue-core-video-player');
Vue.component('vue-core-video-player', getComponent );

Or did I misunderstood this and it can be done?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.