Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
xgplayer-mp4
Advanced tools
xgplayer-mp4模块基于MSE方式实现mp4的播放控制。
import Player from "xgplayer"
import Mp4Plugin from "xgplayer-mp4"
import "xgplayer/dist/xgplayer.min.css"
const player = new Player({
url,
id,
autoplay: true,
height: window.innerHeight,
width: window.innerWidth,
plugins: [Mp4Plugin],
mp4plugin: {
maxBufferLength: 30,
minBufferLength: 10,
reqOptions:{
mode: 'cors',
method: 'POST',
headers: { // 需要带的自定义请求头
'x-test-header': 'rrrr'
},
}
// ... 其他配置
}
})
player.on('canplay', ()=>{
// do something
})
可配置的能力
配置字段 | 默认值 | 含义 |
---|---|---|
maxBufferLength | 40 | 播放的最大的buffer长度(s) |
minBufferLength | 5 | 播放的最小的buffer长度(s) |
disableBufferBreakCheck | false | 是否开启卡顿超时检测 |
waitingTimeOut | 15s | 卡顿超时时间 |
waitingInBufferTimeOut | 5s | 在buffer区间内的卡顿超时时间 |
waitJampBufferMaxCnt | 3 | 一次播放中在buffer区间内卡顿超时最多可以seek调整几次 |
chunkSize | 15625 | 第一次请求的数据的size长度 |
tickInSeconds | 0.1 | 驱动下载的timer的时间间隔 |
segmentDuration | 5s | 一次下载数据的最小视频时长 |
onProcessMinLen | 1024 | fetch每次回调数据的最小长度 |
retryCount | 2 | loader请求失败时的重试次数 |
retryDelay | 1000 | 重试的时间间隔(ms) |
timeout | 3000 | loader请求的超时时间(ms) |
enableWorker | false | transmux是否使用worker |
FAQs
xgplayer plugin for mp4 transform to fmp4
The npm package xgplayer-mp4 receives a total of 271 weekly downloads. As such, xgplayer-mp4 popularity was classified as not popular.
We found that xgplayer-mp4 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.