Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
danmaku-player
Advanced tools
融合了WebGl和Web Componet的实时图像处理弹幕播放器
→ Demo located at https://dwqdaiwenqi.github.io/danmaku-player/example/
通过npm或者cdn获取
npm i danmaku-player
用法和<video/>
标签差不多,直接写入到html中即可
<script src="//unpkg.com/danmaku-player@latest/dist/scripts/danmaku-player.min.js"></script>
<danmaku-player id="player" autoplay="false"
danmakuapi="//static.xyimg.net/cn/static/fed/common/danmaku-list.json"
thumbnail="//static.xyimg.net/cn/static/fed/common/img/thumbnail-tile-90X1-scale-160X90.png"
thumbnailtile="90"
poster="//static.xyimg.net/cn/static/fed/common/img/poster.jpg"
src="//static.xyimg.net/cn/static/fed/common/media/Galileo180.mp4"></danmaku-player>
<script>
var $player = document.querySelector('#player')
// $player.loop = false
$player.autoplay =false
$player.playbackrate=1
$player.enableSendDanmaku=true
$player.enableSwitchDanmaku=true
// $player.play()
$player.addEventListener('senddanmaku',(e)=>{
//debugger
console.log('senddanmaku')
})
$player.addEventListener('progress',e=>{
console.log('progress')
})
$player.addEventListener('loadeddata',e=>{
console.log('loadeddata')
})
$player.addEventListener('canplay',e=>{
console.log('canplay')
})
$player.addEventListener('play',(e)=>{
console.log('play')
})
$player.addEventListener('timeupdate',(e)=>{
console.log('timeupdate')
})
$player.addEventListener('ended',e=>{
console.log('ended.')
})
</script>
import 'danmaku-player'
//...
render(){
// react中需要用ref获取到原生dom对象
return(
<section>
<danmaku-player ref={el=>this.$player=el}src="//static.xyimg.net/cn/static/fed/common/media/Galileo180.mp4"></danmaku-player>
</section>
)
}
componentDidMount(){
this.$player.addEventListener('play',()=>{
//...
})
//...
}
特效指令#xxx,第一次输入#xxx开启了特效,再次输入#xxx关闭特效。目前有#下雪,更多指令待开发...
属性 | 描述 |
---|---|
src | 必须,视频的播放地址,目前支持mp4 |
poster | 不必须,视频海报 |
autoplay | 不必须, |
playbackrate | 不必须, |
loop | 不必须, |
volumn | 不必须, |
事件名 | 描述 |
---|
当调用特效指令,如:#下雪,播放器的渲染就不使用<video/>
了,而是切换成<canvas/>
获取WebGl对象进行渲染。在全屏模式下,WebGl渲染了面积过大的实时视频纹理导致了fps下降,目前无解(有好的解决方法的务必告知~)
对,自动播放和全屏这两个问题移动浏览器没解决,暂时不考虑兼容移动端
不完全一致,虽然很多事件和属性名相同,但是都是经过包装过的
下载个ffmpeg软件,然后执行命令 ``,就生成想要的缩略图了
MIT
FAQs
danmaku-player
The npm package danmaku-player receives a total of 3 weekly downloads. As such, danmaku-player popularity was classified as not popular.
We found that danmaku-player 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.