Giter VIP home page Giter VIP logo

vue-video's Introduction

vue-video

A HTML5 video player component for Vue.js

Demo

live demo is here: https://hilongjw.github.io/vue-video/

Installation

npm i vue-video --save

Usage

// script
import myVideo from 'vue-video'
export default {
    data () {
        return {
            video: {
                sources: [{
                    src: 'http://covteam.u.qiniudn.com/oceans.mp4',
                    type: 'video/mp4'
                }],
                options: {
                    autoplay: true,
                    volume: 0.6,
                    poster: 'http://covteam.u.qiniudn.com/poster.png'
                }
            }
        }
    },
    components: {
        myVideo
    }
}
<template>
    <div id="app">
        <div class="container">
            <my-video :sources="video.sources" :options="video.options"></my-video>
        </div>
    </div>
</template>

API

sources

sources: [{
    // video uri
    src: 'http://covteam.u.qiniudn.com/oceans.mp4',
    // video meta type
    type: 'video/mp4'
}]

options

options: {
    // autoplay
    autoplay: true,
    // default volume
    volume: 0.6,
    // poster (cover image)
    poster: 'http://covteam.u.qiniudn.com/poster.png'
}

vue-video's People

Contributors

hilongjw avatar wilk 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

vue-video's Issues

Uncaught DOMException: Failed to execute 'end' on 'TimeRanges':

video.vue?275a:412 Uncaught DOMException: Failed to execute 'end' on 'TimeRanges': The index provided (0) is greater than or equal to the maximum bound (0).
at HTMLVideoElement.eval (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-video/video.vue?vue&type=script&lang=js&:432:60)

multi video formats and multi video players

How should I define multi formats : mp4 and webm for the same video in one player ?

Can we have multi players on the same page ? how to differentiate them ?

thanks a lot for your work !

进度条有错

getTime() 函数里,绑定了事件,但是无 durationchange & progress 元素

Vuejs 2 integration ?

It should be cool to use this component with Vuejs 2.
Have you planed an update?

Thanks!

cannot be used in weex projects

ERROR Failed to compile with 1 errors 00:12:36

error in ./node_modules/_vue-video@0.1.7@vue-video/video.vue

Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <style>
| .__cov-video-container {
| position: relative;

Seeking video beyond what is loaded can break playback

Experiencing this on Chrome 50.0.2661.102

If you try to seek to a value outside of the range specified by HTMLMediaElement.seekable, the media stops playing (expected) and becomes unresponsive (not expected). I've had this problem on one of my projects and I haven't been able to come up with a good solution yet.

Uncaught DOMException

Uncaught DOMException: Failed to execute 'end' on 'TimeRanges': The index provided (0) is greater than or equal to the maximum bound (0).

init error

Uncaught DOMException: Failed to execute 'end' on 'TimeRanges': The index provided (0) is greater than or equal to the maximum bound (0).
at HTMLVideoElement.eval (webpack-internal:///161:166:96)
getTime方法里this.video.loaded = (-1 + (this.$video.buffered.end(0) / this.$video.duration)) * 100

报错

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

vue-video 支持 IE浏览器吗?

vue-video 在 Chorm 浏览器上可以正常使用,在 IE 浏览器下没有报错,也没有出现正确的结果。是不是vue-video 不支持 IE 浏览器?

411行progress事件需要加判断

this.$video.addEventListener('progress', (e) => {
if(this.$video.onprogress){
this.video.loaded = (-1 + (this.$video.buffered.end(0) / this.$video.duration)) * 100
}
})

加上this.$video.onprogress判断,否则会报错,因为超出范围了。

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.