Socket
Socket
Sign inDemoInstall

awesome-video-player

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    awesome-video-player

A Vue.js based video player with good look and custom user config


Version published
Maintainers
1
Created

Readme

Source

Awesome-Video-Player

A Vue.js based video player with good look and custom user config

good-looking & support custom config

Vue 2 & Vue 3 Support

m3u8 video format Support

How to Use

1. Install

npm install awesome-video-player

2. configure player

  • properties: Video properties.

  • videoStyle: Video style.

  • controlsConfig: Video control settings.

That's it, enjoy!

Support events

Event nameWhen to trigger
playThe media has received a request to start playing
pausePlayback has been suspended
canplayPlayback can start
endedThe media has played once and stopped
waitingPause playback to download more data
canplaythroughPlayback can continue and should not be interrupted. Readstate is 3
errorA network error occurred during the download
volumechangeThe value of the volume or muted property has changed
emptiedThe network connection is down
ratechangeMedia playback rate changes
emptyAn error occurred, blocking media download
seekingPlayback has moved to a new location
timeupdateThe current time was changed unconventionally or unexpectedly
stalledThe browser tried to download but has not received data yet
abortDownload interrupted

Example

<template>
  <div id="app">
    <vam-video
      :properties="videoOption.properties"
      :videoStyle="videoOption.videoStyle"
      :controlsConfig="videoOption.controlsConfig"
      @play="playVideo"
      @canplay="canplayVideo"
      @pause="pauseVideo"
    ></vam-video>
  </div>
</template>

<script>
import AwesomeVideo from "awesome-video-player";
export default {
  name: "App",
  components: {
    AwesomeVideo
  },
  data: () => ({
    videoOption: {
      properties: {
        poster: require("./assets/logo.png"),
        src:
          // "https://mos-vod-drcn.dbankcdn.cn/P_VT/video_injection/2A1343EFA/v3/6CC21C811065945606293295744/MP4Mix_H.264_1920x1080_6000_HEAAC1_PVC_NoCut.mp4",
          "https://tv.youkutv.cc/2019/11/12/mjkHyHycfh0LyS4r/playlist.m3u8",
        preload: "auto",
        // loop: "loop",
        // autoplay:"autoplay",
        // muted:true
      },
      videoStyle: {
        // width: "1200px",
        // height: "600px",
      },
      controlsConfig: {
        fullScreenTit:"全屏",
        EscfullScreenTit:"退出全屏",
        speedTit:"倍速",
        volumeTit:"音量",
        muteTit:"静音",
        playTit:"播放",
        pauseTit:"暂停",
        fullScreen:true,
        speed:true,
        listen:true
      }
    },
  }),
  methods:{
    playVideo(){
      console.log("play");
    },
    pauseVideo(){
      console.log("pause");
    },
    canplayVideo(){
      console.log("canplay");
    }
  }
};
</script>

Keywords

FAQs

Last updated on 01 Jul 2021

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