Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
byted-player
Advanced tools
大家在 头条静态资源库 查询最新版本。
插件依赖播放器本身,所以无论是使用模块化还是使用 CDN 的方式,都需要先加载播放器(安装方式)。安装插件提供两种方式:
import Player from 'byted-player';
import from '[插件名]';// import from 'byted-player-mp4';
import 'byted-player-css';
let player = new Player({
// 配置
});
<link href="//s0.pstatp.com/cdn/expire-1-M/byted-player-css/[版本]/byted-player.css" type="text/css" rel="stylesheet" />
<script src="//s3.pstatp.com/cdn/expire-1-M/byted-player/[版本]/byted-player.min.js" type="application/javascript"></script>
<script src="//s0.pstatp.com/cdn/expire-1-M/[插件名]/[版本]/[插件名].min.js" type="application/javascript"></script>
注意:
<div id="mse"></div>
需要在页面增加“占位符”,告诉播放器要生成的位置。其中 id 是必选项,播放器的宽和高与该容器的宽和高一致。
let player = new Player({
id: 'mse',
url:'/mp4/'
});
or
let player = new Player({
el: document.querySelector('#mse'),
url:'/mp4/'
});
通过实例化Player类就可以生成一个播放器,通过start这个API通知播放器将要播放的视频地址并启动。更多配置选项参考配置
注:播放器的启动不等同于播放
注: 要结合webpack的style-loader和css-loader一起使用。
播放器提供了很多功能强大的插件,如 mp4 流播放、hls 播放、flv 播放、监控与统计、头条视频服务封装等,详情参看 插件
FAQs
video player for web,ie isn't compatible
The npm package byted-player receives a total of 0 weekly downloads. As such, byted-player popularity was classified as not popular.
We found that byted-player 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
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.