All Projects → yisar → Eplayer

yisar / Eplayer

🔮 A web-component html5 video player facing future

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Eplayer

Xgplayer
A HTML5 video player with a parser that saves traffic
Stars: ✭ 4,792 (+1794.07%)
Mutual labels:  player, video-player, html5-video
clappr-core
Core components of the Clappr player architecture
Stars: ✭ 41 (-83.79%)
Mutual labels:  player, video-player, html5-video
Larkplayer
🚀 A lightweight & flexible web player :)
Stars: ✭ 82 (-67.59%)
Mutual labels:  player, video-player, html5-video
Clappr
🎬 An extensible media player for the web.
Stars: ✭ 5,436 (+2048.62%)
Mutual labels:  player, video-player, html5-video
Sbplayerclient
支持全格式的mac版视频播放器
Stars: ✭ 110 (-56.52%)
Mutual labels:  player, video-player
React Video Renderer
Build custom video players effortless
Stars: ✭ 100 (-60.47%)
Mutual labels:  player, video-player
Vime
Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
Stars: ✭ 1,928 (+662.06%)
Mutual labels:  player, web-components
Html5 Dash Hls Rtmp
🌻 HTML5播放器、M3U8直播/点播、RTMP直播、低延迟、推流/播流地址鉴权
Stars: ✭ 1,805 (+613.44%)
Mutual labels:  player, html5-video
Kjplayerdemo
视频播放壳子:动态切换内核,支持边下边播边缓存的播放器方案,视频支持格式:mp4、m3u8、wav、avi,音频支持格式:midi、mp3
Stars: ✭ 60 (-76.28%)
Mutual labels:  player, video-player
Player
FFmpeg and SDL2 video player
Stars: ✭ 119 (-52.96%)
Mutual labels:  player, video-player
Player
▶️ video player in Swift, simple way to play and stream media on iOS/tvOS
Stars: ✭ 1,849 (+630.83%)
Mutual labels:  player, video-player
Html Midi Player
🎹 Play and display MIDI files on the web
Stars: ✭ 158 (-37.55%)
Mutual labels:  player, web-components
Nexplayer unity plugin
Stream videos in HLS & DASH with Widevine DRM using NexPlayer Video Streaming Player SDK for Unity on Android & iOS devices
Stars: ✭ 73 (-71.15%)
Mutual labels:  player, video-player
Nutmeg
Build, test, and publish vanilla Web Components with a little spice
Stars: ✭ 111 (-56.13%)
Mutual labels:  web-components, shadow-dom
Indigo Player
Highly extensible, modern, JavaScript video player. Handles MPEG-Dash / HLS / MPEG-4 and is built on top of the HTML5 video element.
Stars: ✭ 1,173 (+363.64%)
Mutual labels:  video-player, html5-video
React Jplayer
Html5 audio and video player library for React
Stars: ✭ 128 (-49.41%)
Mutual labels:  video-player, html5-video
Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+4703.56%)
Mutual labels:  web-components, shadow-dom
Libvlc Go
Go bindings for libVLC and high-level media player interface
Stars: ✭ 188 (-25.69%)
Mutual labels:  player, video-player
Rtsp.player.android
RTSP player for Android / IP camera viewer
Stars: ✭ 199 (-21.34%)
Mutual labels:  player, video-player
Youtube Extension
🔴YouTube Extension🧰>80 Features ⭐Please document, code or donate📌Tidy📌Longest-standing(2012)(Users>350000)⋮🎞️🎛️🎧⚙️🎬🔊☕🎨🧩🧪📈⏯️(Player: Repeat Screenshot Rotate; Hide related video distraction. Always expand video Description. Playback speed. Video Quality bandwidth H.264 electricity. Player Size Full Window. Themes Customization. Statistics. Reverse Playlist YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube Youtube enhancer YouTube app YouTube video YouTube YouTube YouTube api v3 YouTube playback YouTube player VP8 VP9 AV1 vidIQ tubebuddy download adblocker adblock ads sponsorblock addon youtube music ⭐ youtube premium css css4 html5 ytdl youtube-dl invidious iridium ParticleCore youtube+ youtube++ youtube-plus maia-yt youtube nonstop youtube control center vlogger vlog h264ify h264 m.youtube.com music.youtube.com studio.youtube youtube mobile youtube studio ⭐ kids Vanced gaming.youtube.com gaming youtubecenter freetube lite-youtube-embed newpipe youtube-dl-gui mps-youtube nuclear pytube awesome youtubers youtube downloader 8k 4k 60fps 30fps youtubeexplode vidgear k-lite tubebuddy adobe apple ios iphone design simplify ffmpeg premiere designer annoyance youtube upload
Stars: ✭ 1,027 (+305.93%)
Mutual labels:  player, html5-video

eplayer logo

eplayer NPM version NPM downloads

🎯 A web-components html5 video player facing future.

who use eplayer?

eplayer.js.org - demo

clicli - C 站

Contributors

感谢大家的 pr,阿里嘎多!

Use

  1. ep 基于 web-component,为了兼容,需要事先引入 polyfill
<script src="https://unpkg.com/@webcomponents/webcomponentsjs"></script>
  1. 插入 e-player 标签,没错,只需要将平时用的 video 换成 e-player 即可
<e-player src="./001.mp4"></e-player>

type 属性可选,默认为 mp4,支持 hls 和 flv

  1. 注册 customElement,注意 type=module,使用 es6 的 import
<script type="module">
  import Eplayer from 'https://unpkg.com/eplayer?module'
  //注册 customElement
  customElements.define('e-player', Eplayer)
</script>
  1. 可选定制 css,用于穿透 shadow-dom 预留的默认样式
e-player {
  /* 主题色 默认为 clicli 同款基佬紫*/
  --theme: #00fff6;
  /* 进度条底色 一般不用设置 */
  --progress: rgba(255, 255, 255, 0.3);
  /* 进度条偏移颜色 一般不用设置 */
  --buffer: rgba(255, 255, 255, 0.6);
  /* 图标颜色 一般不用设置 */
  --icons: rgba(255, 255, 255, 0.6);
}
  1. 可选定制插件,会在右击菜单中出现一个选项,触发点击事件
Eplayer.use('github源码', ep => {
  // ep 为 shdow-root 元素
  window.location.href = 'https://github.com/132yse/eplayer'
})

hls

原生支持 mp4mkv ,如果需要支持 m3u8,需要先引入 hls.js

<script src="https://unpkg.com/hls.js"></script>

Npm

yarn add eplayer -S

同样的注册 customElement,但是注意,customElement 只能注册一次,然后还没完,往下看:

omim

omim 是腾讯前端框架 omi 的组件库分支,eplayer 已经集成进去

戳我戳我

Vue

vue 默认是不支持 web-components 的,它无法主动判断含有-的是 vue 组件还是 web 组件

所以需要手动配置,忽略掉e-player

Vue.config.ignoredElements = [
  'e-player'
]

然后,同样需要引入上面的几个文件,然后 bind 一下 src 和 type

<e-player :src="url" :type="type"></e-player>

可以封装成 vue 组件来使用:vue-web-components-wrapper

React / Fre

react 直接支持 customElement,直接在 render 函数中e-player标签

比如,下面这个 fre 的粒子

function EPlayer({ src, type }) {
  const [url, setUrl] = useState(0)
  useEffect(() => {
    fetch(`https://jx.clicli.us/jx?url=${src}@dogecloud`)
      .then(res => res.json())
      .then(data => {
        setUrl(data.url)
      })
  }, [])
  return <e-player src={url} type={type} />
}

完整代码在这里:fre-eplayer

Angular

angular.json 中添加 webcomponentsjshls.js

...
"scripts": [
  "node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js",
  "node_modules/hls.js/dist/hls.min.js"
]
...

app.component.ts 中引入 eplayer

import { Component, OnInit } from "@angular/core";
import Eplayer from "eplayer";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent implements OnInit {
  ngOnInit(): void {
    customElements.define("e-player", Eplayer);
  }
}

在需要使用 eplayer 的模块中启用自定义元素的支持

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { CommonModule } from "@angular/common";
import { VideoComponent } from "./video.component";

@NgModule({
  declarations: [VideoComponent],
  imports: [CommonModule],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class VideoModule {}

在相应的 html 文件中对 srctype 绑定

<e-player [attr.src]="src" [attr.type]="type"></e-player>

完整项目示例: @cliclitv/pwa

ssr

ssr 服务端没有 web-components 的 API,通常 web-components 的 ssr 都会通过一些库去模拟这些 API

eplayer 不推荐这么做,请直接和正常的 html 引入方式一样,引入 cdn

WAP

WAP 端建议使用原生播放器,国产浏览器太乱了,没得兼容,同时建议往 APP 上引流

Screenshot

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].