1备埃、官網(wǎng)下載js包
https://open.ys7.com/mobile/download.html
2总放、(把下載好的ezuikit.js? js包)放進(jìn)vue 的 static 下
3未巫、在index.html引入
<script?src="./static/ezuikit.js"></script>
4唇撬、關(guān)閉eslint
config/index.js? ??
useEslint: false, // (設(shè)置為false)
5拴鸵、組件中使用
···
<template>
??<div?class="video-monitor">
??????<div?class="mainbox-title">
????????<div><span?class="normal-circle"></span></div>
????????<div>
??????????<span?class="title-font">視頻監(jiān)視</span>
????????</div>
??????</div>
??????<div?class="video-box">
????????<video?id="myPlayer"?src="http://hls01open.ys7.com/openlive/f01018a141094b7fa138b9d0b856507b.hd.m3u8"?width='100%'?height="100%"?autoplay?controls?allowfullscreen>
????????</video>
??????</div>
??</div>
</template>
<script>
export?default?{
??data(){
????return?{
??????player:''
????}
??},
??methods:{
????videoOpen(){
??????setTimeout(()?=>?{
????????this.player?=?new?EZUIKit.EZUIPlayer('myPlayer')
??????},?70);
????}
??},
??mounted(){
????this.videoOpen();
??},
??beforeDestroy(){
????this.player.stop();//關(guān)閉視頻流
??}
}
</script>
···