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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vzsdk.js

v1.0.8

Published

vzsdk.js

Readme

vzsdk.js开发说明

功能描述

该SDK主要用于在浏览器上播放臻识设备的视频,特别说明:

  • SDK支持通过局域网和臻云播放设备视频流
  • 局域网播放视频支持flvmjpeg两种格式
  • 臻云播放视频只支持flv格式,不支持mjpeg格式
  • SDK兼容旧版臻云(https://www.vzicar.com)和新版臻云(https://open.vzicloud.com)两个平台
  • 支持PC端浏览器Chrome、Edge,不支持IE浏览器

使用说明

一、安装vzsdk.js

有两种方式可以引入vzsdk.js

1. 直接用<script>引入

直接下载vzsdk.min.js并用<script>标签引入,vzsdk会被注册为一个全局变量。

<script src="vzsdk.min.js"></script>

2. NPM(推荐)

安装

npm install vzsdk.js

引入

import vzsdk from 'vzsdk.js'

二、创建Client对象

引入vzsdk.js后,调用createClient(config)函数创建Client对象。

代码示例

let config = {
  endpoint: 'https://open.vzicloud.com',
	accessKey: {
		id: 'AccessKey  ID',
		secret: 'AccessKey  Secret'
	}
}

let client = vzsdk.createClient(config)

参数说明

| 字段 | 类型 | 是否必传 | 描述 | | ---------------- | ------ | -------- | ------------------------------------------------------------ | | endpoint | string | 是 | 臻云极致地址,旧版臻云为 https://www.vzicar.com,新版臻云为 https://open.vzicloud.com | | accessKey.id | string | 是 | 臻云极致的AccessKey ID | | accessKey.secret | string | 是 | 臻云极致的AccessKey Secret |

三、创建Player对象

要播放视频,必须使用Client对象调用createPlayer(options)创建Player对象。

代码示例

var player = client.createPlayer({
  type: 'flv',
  sn: 'sn',
  dom: 'video',
  mode:'wan', //wan或者lan
  ip:'ip',
  port:'port',
  https:false,
  username:'username',
  password:'password',
})

// 播放视频
player.start()

// 停止播放
player.stop()

参数说明

createPlayer接口的参数说明:

| 字段 | 类型 | 是否必传 | 描述 | | ---- | ---- | -------- | ---- | | type | string | 是 | 视频格式(flv、mjpeg、auto) | | dom | string | 是 | 视频播放容器dom元素的id | | mode | string | 是 | 播放方式,局域网播放(lan)还是臻云远程播放(wan) | | sn | string | 否(mode为wan时必传) | 设备序列号 | | ip | string | 否(mode为lan时必传)| 设备局域网IP | | port | string | 否 | 设备的HTTP端口,默认为80 | | https | boolean | 否 | 设备是否启用HTTPS,默认为false | | username | string | 否(设备视频启用认证时必传) | 设备登陆名称,默认为admin | | password | string | 否(设备视频启用认证时必传) | 设备登陆密码,默认为admin |

完整示例代码(以VUE为例)

<template>
  <div>
    <div id='video'></div>
    <button @click="handleClickStart">start</button>
    <button @click="handleClickStop">stop</button>
  </div>
</template>

<script>
import vzsdk from 'vzsdk.js'

export default {
  name: 'demo',
  data () {
    return {
      player: ''
    }
  },
  mounted () {
    let config = {
      accessKey: {
        id: 'AccessKey ID',
        secret: 'AccessKey Secret'
      },
      endpoint: 'https://open.vzicloud.com'
    }

    let client = vzsdk.createClient(config)

    this.player = client.createPlayer({
      type: 'flv',
      sn: 'sn',
      dom: 'video',
      mode:'wan',//wan或者lan
      ip:'ip',
      port:'port',
      https:false,
      username:'username',
      password:'password',
    })
  },
  methods: {
    handleClickStart () {
      // 开始播放
      this.player.start()
    },

    handleClickStop () {
      // 停止播放
      this.player.stop()
    }
  }
}
</script>