All Projects → xdlumia → vue3-video-play

xdlumia / vue3-video-play

Licence: other
适用于 Vue3 的 hls.js 播放器组件,配置丰富,界面还算好看

Programming Languages

Vue
7211 projects
Less
1899 projects
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
shell
77523 projects
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to vue3-video-play

vue3-video-player
vue3 version of vue-core-video-player
Stars: ✭ 45 (-58.33%)
Mutual labels:  video-player, vue3
vue3-demo
💡 vue3新特性示例: 响应式API、组合式API、TodoMVC
Stars: ✭ 114 (+5.56%)
Mutual labels:  vue3
v-pip
🖼 Tiny vue wrapper for supporting native picture-in-picture mode.
Stars: ✭ 30 (-72.22%)
Mutual labels:  vue3
giantgo-render
基于vue3 element plus的快速表单生成器
Stars: ✭ 28 (-74.07%)
Mutual labels:  vue3
vuejs3-datepicker
vue 3 datepicker. supports disabling, highlighting of dates and programmatic access of date.
Stars: ✭ 23 (-78.7%)
Mutual labels:  vue3
mdue
5,400+ Material Design Icons for Vue 3 from the Community
Stars: ✭ 27 (-75%)
Mutual labels:  vue3
OSAPI
👋 OSAPI 是依靠通用性后台管理平台搭建的API管理平台,基于 vue3、Nestjs 技术栈实现,包含 RBAC 角色权限模块、数据展示、编辑等模块。
Stars: ✭ 32 (-70.37%)
Mutual labels:  vue3
vue4noobs
📗 Tutorial Vue 2~3 in Brazilian Portuguese
Stars: ✭ 230 (+112.96%)
Mutual labels:  vue3
vue-data-visualization
基于Vue3.0的“数据可视化大屏”设计与编辑器
Stars: ✭ 84 (-22.22%)
Mutual labels:  vue3
flutter video list sample
Flutter workout to play video list
Stars: ✭ 30 (-72.22%)
Mutual labels:  video-player
vue3.0-elemenplus-admin-template
一个基于Vue3.0和Element-plus的后台管理模板,一个使用Koa2作为后台程序使用MongoDB作为缓存数据库和MariaDB作为数据的后台管理模板系统
Stars: ✭ 20 (-81.48%)
Mutual labels:  vue3
agnosticui
AgnosticUI is a set of UI primitives that start their lives in clean HTML and CSS. These standards compliant components are then copied to our framework implementations in: React, Vue 3, Angular, and Svelte.
Stars: ✭ 326 (+201.85%)
Mutual labels:  vue3
kaltura-player-js
Kaltura Player JS Platform - Cloud TV and OVP Media Players
Stars: ✭ 83 (-23.15%)
Mutual labels:  video-player
ak-vue3
组件库包含了 AutoForm 自动表单、BackTop 返回顶部、Breadcrumb 面包屑、 Button 按钮、Cascader 级联选择器、Checkbox 多选框、Collapse 折叠面板、ColorPicker 颜色选择器、DataPicker 时间选择器、Dialog 弹层对话框、Alert 弹框、Echarts 图形图表、Form 表单、Input 输入框、Lazy 图片延时加载、Loading 加载等待、Menu 菜单、Pagination 分页、Progress 进度条、Radio 单选框、Select 选择器、Steps 步骤条、Swiper 图片轮播、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 提示、Tr…
Stars: ✭ 24 (-77.78%)
Mutual labels:  vue3
SuperForwardView
A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix.
Stars: ✭ 75 (-30.56%)
Mutual labels:  video-player
vue3-highcharts
Vue 3 component wrapper for Highcharts.js
Stars: ✭ 41 (-62.04%)
Mutual labels:  vue3
sammy-android
Sammy, an advanced video player that enables understanding of videos for the visually-disabled and quicker navigation for everyone
Stars: ✭ 13 (-87.96%)
Mutual labels:  video-player
vuecabulary
用Vue写的高效背单词App,方法来自《17天搞定GRE单词》
Stars: ✭ 47 (-56.48%)
Mutual labels:  vue3
GPS-Video-Logger
Android App to record video and track GPS data simultaneously. GPS Logger with Video. GPS and video recording.
Stars: ✭ 17 (-84.26%)
Mutual labels:  video-player
online-course-script
ocs 网课刷课脚本,帮助大学生解决网课难题,目前支持的平台:超星,智慧树
Stars: ✭ 352 (+225.93%)
Mutual labels:  vue3

Version Downloads GitHub stars GitHub issues GitHub forks GitHub last commit license

NPM

必须使用 [email protected]及以上版本

Vue3-video-play

适用于 Vue3 的 hls.js 播放器组件 | 并且支持 MP4/WebM/Ogg 格式 配置强大,UI 还算好看

功能一览

  1. 支持快捷键操作
  2. 支持倍速播放设置
  3. 支持镜像画面设置
  4. 支持关灯模式设置
  5. 支持画中画模式播放
  6. 支持全屏/网页全屏播放
  7. 支持从固定时间开始播放
  8. 支持移动端,移动端会自动调用自带视频播放器
  9. 支持 hls 视频流播放,支持直播
  10. hls 播放支持清晰度切换

主页示例

https://codelife.cc/vue3-video-play/

近期更新 v1.3.1-beta.3 🎉

  • 新增: 支持 hls 视频流播放
  • 新增: 新增画质切换,需视频流支持
  • 新增: 新增画音视切换,需视频流支持
  • 新增: props 参数增加currentTime属性,可跳转到固定时间播放
  • 新增: props 参数增加type属性,视频格式
  • 新增: props 参数增加controlBtns属性,自定义控制器按钮显示
  • 新增: 右键菜单功能,右键菜单包涵,视频滤镜调节、快捷键说明、复制当前视频网址
  • 新增: mirrorChange loopChange lightOffChange 事件
  • 新增: 增加空格快捷键 播放/暂停 的操作
  • 优化: 如果音量为 0 关闭静音按钮 音量设置为 5

使用指南

安装

npm 安装:

npm i vue3-video-play --save

yarn 安装:

yarn add vue3-video-play --save

开始使用

全局使用

import { createApp } from "vue";
import App from "./App.vue";
let app = createApp(App);

import vue3videoPlay from "vue3-video-play"; // 引入组件
import "vue3-video-play/dist/style.css"; // 引入css
app.use(vue3videoPlay);

app.mount("#app");

组件内使用

// require style
import "vue3-video-play/dist/style.css";
import { videoPlay } from "vue-video-play";
export default {
  components: {
    videoPlay,
  },
};

基本示例

提供了丰富了配置功能 :::demo 自定义配置 比如自定义 poster。

<template>
  <div>
    <vue3VideoPlay
      v-bind="options"
      poster="https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/ironMan.jpg"
    />
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";
const options = reactive({
  width: "800px", //播放器高度
  height: "450px", //播放器高度
  color: "#409eff", //主题色
  title: "", //视频名称
  src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
  muted: false, //静音
  webFullScreen: false,
  speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
  autoPlay: false, //自动播放
  loop: false, //循环播放
  mirror: false, //镜像画面
  ligthOff: false, //关灯模式
  volume: 0.3, //默认音量大小
  control: true, //是否显示控制
  controlBtns: [
    "audioTrack",
    "quality",
    "speedRate",
    "volume",
    "setting",
    "pip",
    "pageFullScreen",
    "fullScreen",
  ], //显示所有按钮,
});
</script>

<style scoped></style>

:::

可以通过propsspeed开启或关闭进度条功能, 并且通过 currentTime属性控制从 60 秒开始播放

:::demo 通过speed关闭进度条拖动功能。 并且通过 currentTime属性控制从 60 秒开始播放

<template>
  <div>
    <vue3VideoPlay
      v-bind="options"
      poster="https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/ironMan.jpg"
    />
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";

const options = reactive({
  width: "500px", //播放器高度
  height: "260px", //播放器高度
  color: "#409eff", //主题色
  currentTime: 60,
  speed: false, //关闭进度条拖动
  title: "", //视频名称
  src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
});
</script>

<style scoped></style>

:::

还可以通过propscontrol属性 来控制是否显示控制器 :::demo 通过control 来控制是否显示控制器

<template>
  <div>
    <vue3VideoPlay
      v-bind="options"
      poster="https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/ironMan.jpg"
    />
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";

const options = reactive({
  width: "500px", //播放器高度
  height: "260px", //播放器高度
  color: "#409eff", //主题色
  control: false, //是否显示控制器
  title: "", //视频名称
  src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
});
</script>

<style scoped></style>

:::

事件示例

:::demo vue3-video-play 支持原生video所有事件。

<template>
  <div>
    <vue3VideoPlay
      width="800px"
      title="钢铁侠"
      :src="options.src"
      :poster="options.poster"
      @play="onPlay"
      @pause="onPause"
      @timeupdate="onTimeupdate"
      @canplay="onCanplay"
    />
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";

const options = reactive({
  src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
  poster: "", //封面
});
const onPlay = (ev) => {
  console.log("播放");
};
const onPause = (ev) => {
  console.log(ev, "暂停");
};

const onTimeupdate = (ev) => {
  console.log(ev, "时间更新");
};
const onCanplay = (ev) => {
  console.log(ev, "可以播放");
};
</script>

<style scoped></style>

:::

Hls m3u8 视频/直播

:::demo vue3-video-play 支持 m3u8(hls)播放

<template>
  <div>
    <vue3VideoPlay
      width="800px"
      title="冰河世纪"
      :src="options.src"
      :type="options.type"
      :autoPlay="false"
    />
  </div>
</template>
<script setup lang="ts">
import { reactive } from "vue";
const options = reactive({
  src: "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8", //视频源
  type: "m3u8", //视频类型
});
</script>

<style scoped></style>

:::

Props

vue3-video-play 支持 video 原生所有 Attributes video 原生属性 使用方式和 props 属性使用一致

名称 说明 类型 可选值 默认值
width 播放器宽度 string - 800px
height 播放器高度 string - 450px
color 播放器主色调 string - #409eff
src 视频资源 string - -
title 视频名称 string - -
type 视频类型 string - video/mp4
poster 视频封面 string - 视频第一帧
webFullScreen 网页全屏 boolean - false
speed 是否支持快进快退 boolean - true
currentTime 跳转到固定播放时间(s) number - 0
playsinline ios 点击屏幕是否全屏 boolean - false
muted 静音 boolean - false
speedRate 倍速配置 array - ["2.0", "1.0", "1.5", "1.25", "0.75", "0.5"]
autoPlay 自动播放 boolean - false,为 true 时会自动静音
loop 循环播放 boolean - false
mirror 镜像画面 boolean - false
ligthOff 关灯模式 boolean - false
volume 默认音量 number 0-1 0.3
control 是否显示控制器 boolean - true
controlBtns 控制器显示的按钮 array ['audioTrack', 'quality', 'speedRate', 'volume', 'setting', 'pip', 'pageFullScreen', 'fullScreen'] ['audioTrack', 'quality', 'speedRate', 'volume', 'setting', 'pip', 'pageFullScreen', 'fullScreen']
preload 预加载 string meta/auto/none auto

props属性 controlBtns 按钮说明

名称 说明
audioTrack 音轨切换按钮
quality 视频质量切换按钮
speedRate 速率切换按钮
volume 音量
setting 设置
pip 画中画按钮
pageFullScreen 网页全屏按钮
fullScreen 全屏按钮

Events

vue3-video-play 支持 video 原生所有事件 video 默认事件

事件名称 说明 回调
mirrorChange 镜像翻转事件 val
loopChange 循环播放开关事件 val
lightOffChange 关灯模式事件 val
loadstart 客户端开始请求数据 event
progress 客户端正在请求数据 event
error 请求数据时遇到错误 event
stalled 网速失速 event
play 开始播放时触发 event
pause 暂停时触发 event
loadedmetadata 成功获取资源长度 event
loadeddata 缓冲中 event
waiting 等待数据,并非错误 event
playing 开始回放 event
canplay 暂停状态下可以播放 event
canplaythrough 可以持续播放 event
timeupdate 更新播放时间 event
ended 播放结束 event
ratechange 播放速率改变 event
durationchange 资源长度改变 event
volumechange 音量改变 event

快捷键说明

支持快捷键操作

键名 说明
Space 暂停/播放
方向右键 → 单次快进 10s,长按 5 倍速播放
方向左键 ← 快退 10s
方向上键 ↑ 音量+10%
方向下键 ↓ 音量-10%
Esc 退出全屏/退出网页全屏
F 全屏/退出全屏

Author

xdlumia

点个 start

vue3-video-play

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