Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
ku-h5player
Advanced tools
A core video player JS lib for web apps.
npm install ku-h5player --save
<script src="http://g.alicdn.com/ku/h5player/0.1.0/ku-h5player.min.js"></script>
<div class="js-player"></div>
var playerContainer = document.querySelector('.js-player');
var player = new new KuH5Player({
container: playerContainer,
source: './videos/1.mp4',
});
const player = new KuH5Player({
container:container, //要实例化的ele
source:source //一个视频流可以为字符串 多个为数组[{source:source,duration:duration}]
type:'m3u8' || 'mp4', //视频类型
decoder:true || false,//不写默认为false 是否需要根据兼容性解码
events:{ // 播放器播放过程中的回调函数
play:function(){
//todo
}
}
component:{
mustUI:UI实例,//MUST为播放器内置插件 可以new obj实例覆盖
Log:log实例 //自定义插件
}
})
# 配置项component里面
component:{
mustUI:false,//播放器内置ui组件 不需要可设置为false或者 重置
videoComponent:videoComponent //外部插入demo组件
}
# videoComponent对象有install注入需要操作的内容
var videoComponent = {
install(){
console.log(12);
}
}
const player = new KuH5Player(config);
// 获取 UI 的 api player.ui
player.ui.setStyle('playicon', {
'background-image': '',
});
// 添加浮层
player.ui.layers.append({
name: 'endList',
html: `<div class="end-list">Your end List</div>`
})
// 自定义浮层
import { Layer } from 'h5-player';
class CustomLayer extends Layer {
constructor(args) {
super(args);
this.find('button').addEventListener('click', (e, video) = > {
video.pause();
})
}
render() {
return `
<div class="h5-layer">
<p>数据列表</P>
<button type="button">Pause</button>
</div>
`;
}
}
player.ui.layer.append(CustomLayer);
// 添加主题, 建议主题另外引入 css
player.ui.setTheme('your-theme-name');
// 注入 css
player.ui.appendCss('your css rules');
FAQs
a powerful HTML5 video player
The npm package ku-h5player receives a total of 4 weekly downloads. As such, ku-h5player popularity was classified as not popular.
We found that ku-h5player demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.