Compare commits
2 Commits
fd74e0e696
...
0dbf8623f0
| Author | SHA1 | Date |
|---|---|---|
|
|
0dbf8623f0 | |
|
|
f6f3e8197d |
|
|
@ -1,6 +1,9 @@
|
|||
<template>
|
||||
<view class="h-full w-full">
|
||||
<div ref="muiPlayer"></div>
|
||||
<iframe class="w-full h-full" v-if="type=='iframe'" :src="url"></iframe>
|
||||
<div ref="muiPlayer" v-else>
|
||||
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -23,73 +26,77 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
videoPlayer() {
|
||||
let parse = {}
|
||||
if (this.type == 'm3u8') {
|
||||
parse = {
|
||||
type: 'hls',
|
||||
loader: Hls,
|
||||
config: {
|
||||
debug: false,
|
||||
},
|
||||
}
|
||||
if (this.type == 'iframe') {
|
||||
console.log("=====");
|
||||
} else {
|
||||
parse = {
|
||||
type: 'flv',
|
||||
loader: Flv,
|
||||
config: {
|
||||
debug: false,
|
||||
},
|
||||
let parse = {}
|
||||
if (this.type == 'm3u8') {
|
||||
parse = {
|
||||
type: 'hls',
|
||||
loader: Hls,
|
||||
config: {
|
||||
debug: false,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
parse = {
|
||||
type: 'flv',
|
||||
loader: Flv,
|
||||
config: {
|
||||
debug: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
this.mp = new MuiPlayer({
|
||||
container: this.$refs.muiPlayer,
|
||||
live: true,
|
||||
src: this.url,
|
||||
autoplay: true,
|
||||
muted: true,
|
||||
parse: parse,
|
||||
pageHead: false,
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
autoFit:false,
|
||||
objectFit: 'contain',
|
||||
videoAttribute: [
|
||||
{
|
||||
attrKey: 'webkit-playsinline',
|
||||
attrValue: 'webkit-playsinline',
|
||||
},
|
||||
{
|
||||
attrKey: 'playsinline',
|
||||
attrValue: 'playsinline',
|
||||
},
|
||||
{
|
||||
attrKey: 'x5-video-player-type',
|
||||
attrValue: 'h5-page',
|
||||
},
|
||||
],
|
||||
custom: {
|
||||
footerControls: [
|
||||
this.mp = new MuiPlayer({
|
||||
container: this.$refs.muiPlayer,
|
||||
live: true,
|
||||
src: this.url,
|
||||
autoplay: true,
|
||||
muted: true,
|
||||
parse: parse,
|
||||
pageHead: false,
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
autoFit: false,
|
||||
objectFit: 'contain',
|
||||
videoAttribute: [
|
||||
{
|
||||
style: {},
|
||||
attrKey: 'webkit-playsinline',
|
||||
attrValue: 'webkit-playsinline',
|
||||
},
|
||||
{
|
||||
attrKey: 'playsinline',
|
||||
attrValue: 'playsinline',
|
||||
},
|
||||
{
|
||||
attrKey: 'x5-video-player-type',
|
||||
attrValue: 'h5-page',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
let _video = this.mp.video()
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.mp.on('ready', (event) => {
|
||||
_video.play()
|
||||
_video.addEventListener('play', (e) => {
|
||||
//播放事件
|
||||
this.$emit('onPlayFn')
|
||||
})
|
||||
_video.addEventListener('ended', (e) => {
|
||||
//播放完成事件
|
||||
this.$emit('onEndedFn')
|
||||
custom: {
|
||||
footerControls: [
|
||||
{
|
||||
style: {},
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
let _video = this.mp.video()
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.mp.on('ready', (event) => {
|
||||
_video.play()
|
||||
_video.addEventListener('play', (e) => {
|
||||
//播放事件
|
||||
this.$emit('onPlayFn')
|
||||
})
|
||||
_video.addEventListener('ended', (e) => {
|
||||
//播放完成事件
|
||||
this.$emit('onEndedFn')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="h-full w-full">
|
||||
<LiveVideo
|
||||
v-if="address"
|
||||
:key="address"
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ export default {
|
|||
},
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
field: 'industry',
|
||||
label: '农业类型',
|
||||
component: 'ApiSelect',
|
||||
componentProps: ({ formActionType }) => {
|
||||
|
|
@ -197,7 +197,7 @@ export default {
|
|||
return data.data
|
||||
},
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
valueField: 'key',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ export default {
|
|||
},
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
field: 'industry',
|
||||
label: '农业类型',
|
||||
component: 'ApiSelect',
|
||||
componentProps: ({ formActionType }) => {
|
||||
|
|
@ -169,7 +169,7 @@ export default {
|
|||
return data.data
|
||||
},
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
valueField: 'key',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -178,15 +178,15 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
options() {
|
||||
return [
|
||||
|
||||
].filter((e) => checkPermission(e.permission))
|
||||
return [].filter((e) => checkPermission(e.permission))
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleSubmit(e) {
|
||||
this.filterParmas = e
|
||||
this.mescroll.resetUpScroll()
|
||||
this.$nextTick(() => {
|
||||
this.mescroll.resetUpScroll()
|
||||
})
|
||||
},
|
||||
upCallback({ num, size }) {
|
||||
this.getData({
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
</view>
|
||||
<view class="content-box">
|
||||
<view class="video_ul" v-show="current == 0">
|
||||
<view class="video_li" v-for="(video, index) in videoList" :key="video.video_url+index">
|
||||
<view class="video_li" v-for="(video, index) in videoList" :key="index+'s'">
|
||||
<view class="video_cd">
|
||||
<!-- #ifdef H5 -->
|
||||
<!-- {{ video.video_url }} -->
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
<view
|
||||
class="video_li"
|
||||
v-for="(video, index) in videoList2"
|
||||
:key="video.video_url+index"
|
||||
:key="index+'s2'"
|
||||
>
|
||||
<view class="video_cd">
|
||||
<!-- #ifdef H5 -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue