个人 UI 组件库
首页
core
vant2
element2
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)

放肆青春

一个前端菜鸟的技术成长之路
首页
core
vant2
element2
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)
  • 开发指南

    • 快速上手
  • 自定义组件

    • button
    • tabs
    • video
      • 概述
      • 基础布局
        • 属性
        • 事件
    • svg
  • core
放肆青春
2021-12-31

video

# video


# 概述

基于 video 标签封装的视频播放组件

# 基础布局

<!-- 视频播放器 -->
<RzVideo
  :id="videoId"
  title="视频标题"
  width="500px"
  height="200px"
  :video-url="videoUrl"
  :poster-url="videoPoster"
  @onplay="onplay"
/>
<script>
  export default {
    data() {
      return {
        videoId: "20210807-0001", // 视频id
        videoUrl: "https://www.runoob.com/try/demo_source/movie.mp4", // 视频链接
        videoPoster: "https://www.baidu.com/img/flexible/logo/pc/result.png", // 视频封面地址
      };
    },
    methods: {
      // 视频播放事件
      onplay() {
        // 可以通过视频id控制统一事件内只播放一个视频
      },
    },
  };
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Expand Copy Copy

# 属性

参数 说明 类型 可选值 默认值
id 视频 id string — false
title 视频标题 string -
width 视频宽度 string 500px
height 视频高度 string 200px
video-url 视频链接 string -
poster-url 视频封面 string -

# 事件

事件名称 说明 回调参数
onplay 视频播放事件 —
更新时间: 1/4/2022, 1:45:26 PM
tabs
svg

← tabs svg→

最近更新
01
快速上手
12-31
02
dialog
12-31
03
address
12-31
更多文章>
Theme by Vdoing | Copyright © 2019-2022 放肆青春
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式