
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
vue-player-audio
Advanced tools
播放音频文件,支持设置播放时间区间(Vue@2组件)
demo:https://realgeoffrey.github.io/vue-player-audio/demo/index.html
Node.js安装
npm install vue-player-audio --save
浏览器引用
<!-- 需要先引入vue:<script src="//unpkg.com/vue@2"></script> -->
<script src="//unpkg.com/vue-player-audio"></script>
Node.js注册
全局注册
import Vue from 'vue'
import vuePlayerAudio from 'vue-player-audio'
// 全局注册
Vue.use(vuePlayerAudio, { component: 'PlayerAudio' }) // 组件名默认是:vue-player-audio
// 或:Vue.component('PlayerAudio', vuePlayerAudio)
局部注册
import vuePlayerAudio from 'vue-player-audio'
export default {
components: {
// 局部注册
PlayerAudio: vuePlayerAudio
}
}
浏览器注册
全局注册
<!-- 需要先引入vue:<script src="//unpkg.com/vue@2"></script> -->
<!-- 需要先引入vue-player-audio:<script src="//unpkg.com/vue-player-audio"></script> -->
<script>
// 全局注册
Vue.use(vuePlayerAudio, { component: 'vue-player-audio' }) // 组件名默认是:vue-player-audio
// 或:Vue.component('vue-player-audio', vuePlayerAudio)
</script>
局部注册
<!-- 需要先引入vue:<script src="//unpkg.com/vue@2"></script> -->
<!-- 需要先引入vue-player-audio:<script src="//unpkg.com/vue-player-audio"></script> -->
<script>
new Vue({
components: {
// 局部注册
'vue-player-audio': vuePlayerAudio
}
})
</script>
参数
<PlayerAudio
:audio-src="音频src(必填)"
:start-second="开始秒数(0)"
:end-second="结束秒数,0表示直到音频结束,起码播放1秒(0)"
:autoplay="自动播放(false)"
:loop="循环播放(false)"
:loop-gap-millisecond="循环播放间隔时间-毫秒,起码间隔50毫秒(50)"
:controls="展示控制面板(false)"
:preload="预加载模式,none、metadata、auto('metadata')"
/>
因为兼容性问题,
end-second
与start-second
最少间隔1秒,loop-gap-millisecond
最少设置50毫秒。
插槽
<PlayerAudio
:audio-src="音频src(必填)"
v-slot="audioData"
>
<br>
是否在播放:{{ audioData.isPlaying }}
<br>
当前时间:{{ audioData.currentSecond }}
<br>
最大时间:{{ audioData.maxSecond }}
<br>
</PlayerAudio>
可使用audiosprite等音频组合工具把多个音频文件组合成一个,然后再使用本插件的音频播放时间区间,从而减少请求数。
FAQs
播放音频文件,支持设置播放时间区间(Vue@2组件)
The npm package vue-player-audio receives a total of 123 weekly downloads. As such, vue-player-audio popularity was classified as not popular.
We found that vue-player-audio demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.