
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
使用AudioContext有下面几个好处
wmplayer实现对AudioContext的封装,可以很方便的使用
引入wmplayer
npm i wmplayer -S
npm安装
npm i -S wmplayer
import MPlayer from 'wmplayer'
// 挂载MPlayer构造函数
初始化
wmplayer.create('./1.mp3')
wmplayer.create(['./1.mp3', './2.mp3'], {
baseUrl: '/assets',
})
wmplayer.create(resource, options)
resouce:可以传出一个url string、一个ArrayBuffer或者值为url string的数组
options:一个对象,配置参数如下
false10,从即第1首开始1024let player = wmplayer.create(resource, {
loop: false,
volume: 0.6,
fftSize: 512,
cacheCount: 10,
playMode: wmplayer.PlayMode.rand,
})
player.onload = function() {
this.play()
}
事件绑定
// 初始化时设置
let player = new wmplayer.create('./1.mp3')
// 添加事件监听方法,会覆盖之前用该方式绑定的监听方法
player.onload = function () { ... }
// 添加事件监听方法,会保留该事件的其他监听方法,可同时设置多个事件
player.on('load', function () { ... })
取消监听
// 解除事件绑定
player.off('load', fn)
// 解除某事件下所有监听绑定
player.off('load')
属性 props
numbernumberPlayMode方法 methods
事件 events
onload:音频解析完成时触发
onended:音频播放完触发
oncatch:捕捉异常
MIT
FAQs
wmplayer实现对AudioContext的封装,可以快速的开发音乐播放器,可以对音频分析,做音频可视化
We found that wmplayer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.