Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

vzanplayer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vzanplayer

vzan player

latest
npmnpm
Version
1.0.50
Version published
Weekly downloads
5
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

微赞播放器

VZANPlayer 是 微赞播放器 的主入口,通过 new VZANPlayer() 方法可以创建一个支持音视频播放的媒体对象。

启动&打包

启动本地调试 npm run dev 打包 JS SDK npm run build 生成文档 npm run docs

简易教程

快速跑通 Demo

播放 API

API参数说明
mute静音
unmute取消静音
isFullscreen获取播放全屏状态
enterFullScreen唤起全屏
exitFullScreen退出全屏
destroy销毁播放器
width获取播放器宽度
height获取播放器高度
on添加事件监听
emitname 事件名称 value 事件传递触发事件
offname 事件名称 listerner事件回调(传空 则移除所有监听)解绑事件 取消事件监听
currentTime秒数(Number)获取、设置当前播放时间 单位:秒
play播放
pause暂停
toggle播放/暂停切换
seek秒数(Number)快进播放
setSpeed倍数值 0.5,1,1.5,2设置播放倍速
setVolume0 ~ 1设置音量
versionversion当前版本号
initConifg初始化 options 设置
switchVideourl切换播放地址
setLiveState是否为直播中(Boolean)显示直播状态控制栏
duration获取总时长,秒数(Boolean)

控制栏 API

API参数说明
clearLoading清除视频 loading 样式
loading显示视频 loading 样式
hideBar隐藏播放控制栏
showBar显示播放控制栏
hideSpeed关闭 倍速控制 按钮
showSpeed开启 倍速控制 按钮
toggleBar切换 播放控制栏显示与隐藏

媒体事件监听

Keywords

vzan

FAQs

Package last updated on 10 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts