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

ayra-vue-flv-player

v1.1.0

Published

> 此组件为基于vue的flash播放器组件, > 功能包括播放、暂停、音量控制、全屏、关灯模式、水印。

Downloads

16

Readme

ayra-vue-flv-player

此组件为基于vue的flash播放器组件, 功能包括播放、暂停、音量控制、全屏、关灯模式、水印。

安装

$ dnpm install ayra-vue-flv-player

使用示例

main.js
import Player from 'ayra-vue-flv-player/lib/index.umd.js';
import 'ayra-vue-flv-player/lib/index.css'
Vue.use(Player)
template部分
<template>
    <div class="app">
        <Player ref="player"
                :option="playerOptions"
                @playerPlay="playerPlay"
                @playerPause="playerPause"
                @onPlayerWaiting="onPlayerWaiting"
                @onPlayerPlaying="onPlayerPlaying"
                @onPlayerError="onPlayerError"
                @onPlayerSizeChange="onPlayerSizeChange"
                @onLightControl="onLightControl"
                >
        </Player>
    </div>
</template>
script 部分
<script>
export default {
  name: 'App',
  data () {
    return {
      playerOptions: {
        waterMarkText: 'abc',   // 水印内容
        user: 'test',           // 用户域帐号
        lightControl: false,    // 是否启用关灯模式控制
        volumeControl: true,    // 是否启用音量控制
      }
    }
  },
  mounted () {
    // 生产
    this.$refs.player.play('liveId')
    // 预发
    // this.$refs.player.prePlay('preLiveId')
    // 测试
    // this.$refs.player.testPlay('testLiveId')
  },
  methods: {
    playerPlay() {
      console.log('player - play')
    },
    playerPause() {
      console.log('player - pause')
    },
    onPlayerWaiting(time) {
      console.log('player - waiting time: ', time)
    },
    onPlayerPlaying(time) {
      console.log('player - playing time: ', time)
    },
    onPlayerError(error) {
      console.log('player - error: ', error)
    },
    onPlayerSizeChange() {
      console.log('player - player size change')
    },
    onLightControl(isLightOff) {
      console.log('player - is light off: ', isLightOff)
    },
  }
}
</script>

说明

options内属性

属性 | 类型 | 描述

  •         | :-:     | :-

waterMarkText | string | 水印内容 user | string | 用户域账号 lightControl | boolean | 是否启用关灯模式控制 volumeControl | boolean | 是否启用音量控制

方法

方法 | 参数 | 描述

  • | :-: | :- play | 参数类型描述liveIdstring直播id | 播放

事件

事件 | 描述 | 备注

  •               |   :-              | :-

playerPlay | 播放开始 | playerPause | 播放暂停 | onPlayerWaiting | 等待播放 | 可用于判断卡顿,time为自视频开始播放到触发此事件的时间(单位:ms) onPlayerPlaying | 开始播放 | 开始播放时触发,也可用于判断卡顿停止,time为自视频开始播放到触发此事件的时间(单位:ms) onPlayerError | 播放异常 | 若无直播无流地址触发(若直播时间已开始,但触发此情况:{ errorCode: 4001, errorMessage: '未获取到视频流' },有可能为还未开始直播推流或中途休息停止推流) onPlayerSizeChange | 播放器大小改变 | onLightControl | 关灯模式 | isLightOff为0/1,0为开灯,1为关灯(如使用关灯模式,需根据此事件自行处理样式)