All Projects → c10342 → media-player

c10342 / media-player

Licence: MIT license
H5视频播放器,可自定义插件

Programming Languages

typescript
32286 projects
SCSS
7915 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
shell
77523 projects

Projects that are alternatives of or similar to media-player

somafm
📻 A SomaFM Desktop Player
Stars: ✭ 20 (-44.44%)
Mutual labels:  player
niki
Media Player, DLNA, Music, Video and Streaming
Stars: ✭ 14 (-61.11%)
Mutual labels:  player
FFmpegPlayer
Simple FFmpeg video player
Stars: ✭ 72 (+100%)
Mutual labels:  player
playmyvideos
An elementary OS app
Stars: ✭ 25 (-30.56%)
Mutual labels:  player
h-player-web
资源采集站在线播放
Stars: ✭ 16 (-55.56%)
Mutual labels:  player
datmusic-android
Music search, downloader & player app using Jetpack Compose
Stars: ✭ 448 (+1144.44%)
Mutual labels:  player
leaflet-react-track-player
This is plugin for react-leaflet. It create player for control of track. 🍃🌎⚔
Stars: ✭ 21 (-41.67%)
Mutual labels:  player
roover
🐱 A lightweight audio library for React apps.
Stars: ✭ 70 (+94.44%)
Mutual labels:  player
bitmovin-player-ui
The Bitmovin Adaptive Streaming Player UI
Stars: ✭ 115 (+219.44%)
Mutual labels:  player
feeluown-core
提供音乐播放器的一些常见组成模块(已经合并到 feeluown 项目中)
Stars: ✭ 30 (-16.67%)
Mutual labels:  player
trackswitch.js
A Versatile Web-Based Audio Player for Presenting Scientific Results
Stars: ✭ 39 (+8.33%)
Mutual labels:  player
StreamLinkerino
Twitch.tv client using only StreamLink, MPV, and Chatterino
Stars: ✭ 26 (-27.78%)
Mutual labels:  player
DanMuPlayer
A ffmpeg based player for tvOS TVML support DanMu
Stars: ✭ 40 (+11.11%)
Mutual labels:  player
pxtnplay
Play Pxtone Collage files in Linux or MacOS.
Stars: ✭ 30 (-16.67%)
Mutual labels:  player
player-ffmpeg
Up to date tutorial of ffmpeg
Stars: ✭ 17 (-52.78%)
Mutual labels:  player
audioplayer editor
Audio Player ID3 editor add-on for the Audio Player in Nextcloud & ownCloud
Stars: ✭ 24 (-33.33%)
Mutual labels:  player
clappr-core
Core components of the Clappr player architecture
Stars: ✭ 41 (+13.89%)
Mutual labels:  player
HAudioPlayer
AVPlayer再封装,实现类网易云音乐播放动画效果
Stars: ✭ 15 (-58.33%)
Mutual labels:  player
soube
Music player based on electronjs
Stars: ✭ 32 (-11.11%)
Mutual labels:  player
HJPlayer
A HTML5 Player, can play flv and hls by Media Source Extension, based on typescript.
Stars: ✭ 149 (+313.89%)
Mutual labels:  player

MediaPlayer

可定制,插件化,轻量灵活的视频播放器

npm version downloads gzip size LICENSE Test Codacy Badge

在线文档

http://player.linjiafu.top

简介

MediaPlayer 是由多包架构组成的开源项目。其中@lin-media/player为核心包,集成了一些常用的功能,如清晰度切换,倍数播放,全屏等等;其他非常见功能通过插件的形式扩展使用,如截图,弹幕,自定义进度条提示点等等;其中,插件以第三方包的形式存在,独立于@lin-media/player核心包,使用的时候需要自行进行下载安装。

目前有六个插件包,分别为:

  • 弹幕插件 @lin-media/danmaku
  • 缩放插件 @lin-media/zoom
  • 截图插件 @lin-media/screenshot
  • 右键菜单插件 @lin-media/contextmenu
  • 视频缩略图预览插件 @lin-media/preview
  • 自定义进度条提示插件 @lin-media/highlight

为什么要使用插件的形式扩展?

1、考虑到一些功能使用频率不高,但我们在打包的时候也无法剔除这些功能,这样就会导致我们的打包体积变大。

2、开闭原则。当我们需要实现新的功能的是时候,可通过插件的形式去实现,而不是在@lin-media/player这个核心包中添加功能

3、防止包的体积无限制得增大。插件功能天然支持按需加载功能

特点

  • 基于typescript开发的一款视频播放器
  • 没有第三方依赖
  • 支持插件功能,可定制一些其他的功能
  • 按需加载
  • 使用原生css变量实现自定义主题
  • 支持移动端和pc端

安装使用

安装

npm i @lin-media/player

初始化

import MediaPlayer from "@lin-media/player";
const player = new MediaPlayer({
  // 容器
  el: ".container",
  // 视频列表
  videoList: [
    {
      label: "标清",
      url: "http://127.0.0.1/demo.mp4"
    },
    {
      label: "高清",
      url: "http://127.0.0.1/demo.mp4"
    }
  ]
});

经过上述步骤,一个具有常见功能的视频播放器就会出现在你的眼前!!!

使用插件

以弹幕插件为例:

安装

npm i @lin-media/danmaku

注册使用插件

import MediaPlayer from "@lin-media/player";
import Danmaku from "@lin-media/danmaku";
// 全局注册插件。插件注册分全局注册和局部注册
MediaPlayer.use(Danmaku);

const player = new MediaPlayer({
  // ...
  Danmaku: {
    // 弹幕字体颜色,随机
    fontColors: ["blue", "red", "green", "#fff"],
    // 弹幕字体大小随机
    fontSizes: [16, 18, 20, 22, 24, 26, 28]
  }
});

发送弹幕

player.danmaku.send('你好')

浏览器支持

注意:默认不支持IE浏览器,如果你有需要,请自行使用 polyfill 进行兼容

问题 & 建议

如果你在使用 MediaPlayer 时遇到问题,或者有好的建议,欢迎给我提 Issue

贡献

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

LICENSE

MIT

其他

更详细的功能请查看在线文档,点击这里

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].