22 Star 212 Fork 52

wopen / nplayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

NPlayer

npm version gzip size Codacy Badge Test Discord

NPlayer 是由 Typescript 加 Sass 编写,无任何第三方运行时依赖,兼容 IE11,支持移动端、支持 SSR、支持直播。高度可定制,所有图标、主题色等都可以替换,并且提供了内置组件方便二次开发。你可以自定义任意多个断点,不仅仅是兼容移动端,只要愿意,你可以非常轻松的兼容手机竖屏、手机横屏、平板等设备。它还拥有插件系统,弹幕功能就是使用插件形式提供,使用时按需引入即可。该播放器还可以接入任何流媒体,如 hls、dash 和 flv 等。欢迎 Star~

https://user-images.githubusercontent.com/25923128/118526973-5def0680-b773-11eb-9aa4-364dca7d5eaa.mov

安装

npm i -S nplayer

或者使用 CDN

<script src="https://unpkg.com/nplayer@latest/dist/index.min.js"></script>

快速使用

import Player from "nplayer";

/**
 * Danmaku DEMO:
 *    https://codesandbox.io/s/nplayer-demo-ujtms?file=/src/index.js
 * React DEMO:
 *    https://codesandbox.io/s/nplayer-react-demo-p558g?file=/src/App.js
 * Vue2 DEMO:
 *    https://codesandbox.io/s/nplayer-vue2-demo-9lps9?file=/src/main.js
 * Vue3 DEMO:
 *    https://codesandbox.io/s/nplayer-vue3-demo-mt8s4?file=/src/main.js
 */
const player = new Player({
  src: "https://v-cdn.zjol.com.cn/280443.mp4"
});

player.mount(document.body);

image

DEMO

文档

你可以在 nplayer.js.org 查看 NPlayer 的文档。

查看 快速入门章节 来快速上手 NPlayer。

生态

名称 版本 大小
弹幕插件 npm gzip size
React npm gzip size
Vue2 / Vue3 npm gzip size

例子

推荐文章

问题 & 新功能

如果你遇到 BUG 或者是想要新功能,欢迎提交 issue

贡献

如果想参与贡献,请查看 CONTRIBUTING

MIT License Copyright (c) wopen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

无任何第三方运行时依赖,兼容 IE11,支持 SSR。高度可定制,可二次开发。和 B 站一样体验的弹幕系统。可以接入任何流媒体,支持直播。 展开 收起
TypeScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/wopen/nplayer.git
git@gitee.com:wopen/nplayer.git
wopen
nplayer
nplayer
main

搜索帮助