npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wgi-video-player

v0.0.5

Published

基于vue-video-player的二次封装,使用flv | hls | rtmp | mp4这四种流更方便

Downloads

3

Readme

wgi-video-player

安装


npm install wgi-video-player -D

使用方法:


在需要使用的 vue 文件中
import WgiVideoPlayer from "wgi-video-player";
import "wgi-video-player/lib/wgi-video-player.css";
注册组件
components: {
WgiVideoPlayer
},
template 使用
<WgiVideoPlayer src="http://live.cgtn.com/1000/prog_index.m3u8" type="hls" width="560px" height="350px" />

props 说明:


1.简单使用传递 type 和 src 即可,本插件已经初步集成 type: "flv" | "hls" | "rtmp" | "mp4" 2.如果初步集成的四种流类型不符合您的需求,可以传递 "playerOptions",数据结构同 vue-video-player 接收的参数,来构造您的需求

type:


{
// 视频流类型 flv/hls/rtmp/mp4
// eslint-disable-next-line vue/require-prop-type-constructor
type: "flv" | "hls" | "rtmp" | "mp4"
},

src:


    {
    // 视频流地址
    type: String
    },

width:


    {
    type: String,
    default: "100%"
    },

height:


    {
      type: String,
      default: "100%"
    },

playsinline:


    {
      type: Boolean,
      default: true
    },

playbackRates:


    {
      //播放速度
      type: Array,
      default: () => [0.5, 1.0, 1.5, 2.0]
    },

language:


    {
      // 语言
      type: String,
      default: "zh-CN"
    },

autoplay:


    {
      // 是否等浏览器准备好后自动播放
      type: Boolean,
      default: false
    },

preload:


    {
      // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
      type: String,
      default: "auto"
    },

fluid:


    {
      // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
      type: Boolean,
      default: false
    },

controls:


    {
      // 是否打开控制按钮
      type: Boolean,
      default: true
    },

controlBar:


    {
      //控制按钮
      type: Object,
      default: () => ({
        timeDivider: true,
        durationDisplay: true,
        remainingTimeDisplay: false,
        fullscreenToggle: true //全屏按钮
      })
    },

poster:


    {
      // 封面地址
      type: String,
      default: ""
    },

notSupportedMessage:


    {
      type: String,
      default: "不支持的视频格式"
    },

playerOptions:


    {
      // 可以自己传一个option
      type: Object
    }