0.1.18 • Published 3 months ago

vue2-h5-compatibility-video v0.1.18

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

vue2-h5-compatibility-video

# 添加依赖
npm i vue2-h5-compatibility-video

引入:

import Vue from "vue";
import { getVideoComponents } from 'vue2-h5-compatibility-video'
import 'vue2-h5-compatibility-video/lib/style.css'

const { InsideVideo, FullscreenVideo } = getVideoComponents();
Vue.component("InsideVideo", InsideVideo);
Vue.component("FullscreenVideo", FullscreenVideo);

使用内联视频:

<inside-video
  :src="url"
  :height="height"
  :poster="poster"
  :autoplay="true"
  :loop="true"
/>

使用全屏视频:

<fullscreen-video
  :src="url"
  :height="height"
  :poster="poster"
  @click="show"
  ref="refFullscreenVideo"
/>

<script>
const refFullscreenVideo = ref()
const show = () => {
  refFullscreenVideo.value?.showFullScreen()
}
</script>

添加全局点击事件:

import { getEmitter } from 'vue2-h5-compatibility-video'
// 当页面触发点击时,调用下面的方法,这样会通知视频组件播放
getEmitter().emit("docTouch")
0.1.17

3 months ago

0.1.18

3 months ago

0.1.11

4 months ago

0.1.12

4 months ago

0.1.13

4 months ago

0.1.14

4 months ago

0.1.15

4 months ago

0.1.16

4 months ago

0.1.10

4 months ago

0.1.9

5 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago