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

iotx-videoplayer

v0.0.3

Published

videoplayer videojs封装的组件

Downloads

25

Readme

VideoPlayer

install

npm install iotx-videoplayer

引入cdn

<link rel="stylesheet" href="//g.alicdn.com/linkplatform/videojs-plugins/0.0.6??plugin-scale.css,plugin-refresh.css,plugin-end.css"></link>
<script src="//g.alicdn.com/linkplatform/videojs-plugins/0.0.6??tech-flv.js,plugin-hls-compat.js,tech-h265.js"></script>

组件api

| 属性 | 类型 | 默认值 | 是否必填 | 备注 | |---------------------|--------------------------------------------------------------------------------------------------------------------------------|--------|---------|------------------------| | getSource | Promise<{[p: string]: any;url: string;}> | - | 是 | 获取视频资源的Promise | | className | string | - | 否 | className | | isLive | boolean | true | 否 | 视频是否是直播 | | isH265 | boolean | false | 否 | 视频是否是h265编码 | | allowPtzControl | boolean | false | 否 | 视频是否允许ptz控制 | | allowDrawScale | boolean | false | 否 | 视频是否允许拉框缩放 | | allowAudioBroadcast | boolean | false | 否 | 视频是否允许语音广播 | | hasSpeed | boolean | false | 否 | 视频是否有播放速度控制 | | timeLineGroup | Array<{[p: string]: any;id: string;content: string;}> | false | 否 | 路放回放资源组 | | playbackStartTime | moment.Dayjs | - | 否 | 回放开始时间 | | onInit | (player) => void | - | 否 | 初始化结束回调 | | onClick | () => void | - | 否 | 播放器点击回调 | | onPlaySpeedChange | (time) => void | - | 否 | 倍速调节回调 | | onRecordSend | (data) => void | - | 否 | 语音广播发送回调 | | onZoomChange | (action: any, options: any) => void | - | 否 | 拉框缩放回调 | | onCommand | ({speed: number; command: string;}) => void | - | 否 | ptz控制回调 | | onAddPreset | (values) => Promise; | - | 否 | 保存ptz控制 | | onFetchRecordList | (param: {deviceId: string;startTime: number;endTime: number;}, pagination: {pageNo: number;pageSize: number;}) => Promise | - | 否 | 请求回放列表参数 | | handleDataOnChange | (time): void | - | 否 | 日期变化回调 | | handleRangeOnChange | (time, filters): void | - | 否 | 时间段变化回调 |

例子

  <VideoPlayer
    getSource={() => Promise.resolve({ url: 'https://playtv-live.ifeng.com/live/06OLEGEGM4G_tv1.m3u8' })}
    allowPtzControl
    allowAudioBroadcast
    onZoomChange={console.log}
    onRecordSend={console.log}
    onCommand={console.log}
    // timeLineGroup={[
    //   {
    //     id: '123',
    //     content: 'adsd',
    //   },
    // ]}
    onAddPreset={(values) => {
      console.log(values);
      return Promise.resolve(1);
    }}
    // timeLineGroup={[{ ...device, id: `${device.deviceId}_${date.valueOf()}`, content: device.name }]}
  />