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

lcap-video

v0.1.4

Published

<!-- 该 README.md 根据 api.yaml 和 docs/*.md 自动生成,为了方便在 GitHub 和 NPM 上查阅。如需修改,请查看源文件 -->

Downloads

7

Readme

LcapVideo 视频

Media

基于 video.js 的视频播放组件

示例

基本用法

<template>
  <lcap-video :src="src" poster="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fd7cf4b85-be50-4ab8-b21e-4d4bb5f78460%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1690422928&t=815c2bd1e4445a1fd1904242842dc062" width="1200" @start="onStart" @play="onPlay"></lcap-video>
</template>

<script>
export default {
    data() {
        return {
            src: 'https://static-vusion.nos-eastchina1.126.net/tutorial/%E5%AD%A6%E4%B9%A0%E4%B8%AD%E5%BF%83%E8%A7%86%E9%A2%91/%E4%B8%93%E9%A2%98%E8%AF%BE%E7%A8%8B/%E4%B8%93%E9%A2%98%E8%AF%BE%E7%A8%8B%EF%BC%9AAPI%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97.mp4',
        }
    },
    methods: {
        onStart() {
            console.log('播放开始时');
        },
        onPlay() {
            console.log('继续播放时');
        },
    },
}
</script>

断点播放

<template>
  <lcap-video :src="src" width="1200" @start="onStart" @play="onPlay" :breakProgress="progress"></lcap-video>
</template>

<script>
export default {
    data() {
        return {
            src: 'https://static-vusion.nos-eastchina1.126.net/tutorial/%E5%AD%A6%E4%B9%A0%E4%B8%AD%E5%BF%83%E8%A7%86%E9%A2%91/%E4%B8%93%E9%A2%98%E8%AF%BE%E7%A8%8B/%E4%B8%93%E9%A2%98%E8%AF%BE%E7%A8%8B%EF%BC%9AAPI%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97.mp4',
            progress: '',
        }
    },
    mounted(){
      setTimeout(()=>{this.progress = '50%'}, 2000)
    },
    methods: {
        onStart() {
            console.log('播放开始时');
        },
        onPlay() {
            console.log('继续播放时');
        },
    },
}
</script>

API

Props/Attrs

| Prop/Attr | Type | Options | Default | Description | | --------- | ---- | ------- | ------- | ----------- | | src | string | | | 视频流地址 | | poster | image | | | 视频默认封面地址 | | breakProgress | string | | | 从中断的进度开始播放 | | autoplay | boolean | | false | 是否自动播放 | | draggable | boolean | | true | 是否可拖放 | | loop | boolean | | false | 是否循环播放 |

Events

@start

| Param | Type | Description | | ----- | ---- | ----------- | | $event | object | 播放器实例对象 |

@pause

| Param | Type | Description | | ----- | ---- | ----------- | | $event | object | 播放器实例对象 |

@play

| Param | Type | Description | | ----- | ---- | ----------- | | $event | object | 播放器实例对象 |

@ended

| Param | Type | Description | | ----- | ---- | ----------- | | $event | object | 播放器实例对象 |

@videoProgress

| Param | Type | Description | | ----- | ---- | ----------- | | $event | string | 播放进度百分比 |

Methods

play()

继续播放

| Param | Type | Default | Description | | ----- | ---- | ------- | ----------- |

pause()

暂停播放

| Param | Type | Default | Description | | ----- | ---- | ------- | ----------- |