Compare commits

...

2 Commits

Author SHA1 Message Date
ihzero 0dbf8623f0 添加iframe监控 2023-12-31 10:20:42 +08:00
ihzero f6f3e8197d 修改 2023-12-30 23:06:53 +08:00
5 changed files with 79 additions and 72 deletions

View File

@ -1,6 +1,9 @@
<template> <template>
<view class="h-full w-full"> <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> </view>
</template> </template>
<script> <script>
@ -23,73 +26,77 @@ export default {
}, },
methods: { methods: {
videoPlayer() { videoPlayer() {
let parse = {} if (this.type == 'iframe') {
if (this.type == 'm3u8') { console.log("=====");
parse = {
type: 'hls',
loader: Hls,
config: {
debug: false,
},
}
} else { } else {
parse = { let parse = {}
type: 'flv', if (this.type == 'm3u8') {
loader: Flv, parse = {
config: { type: 'hls',
debug: false, loader: Hls,
}, config: {
debug: false,
},
}
} else {
parse = {
type: 'flv',
loader: Flv,
config: {
debug: false,
},
}
} }
} this.mp = new MuiPlayer({
this.mp = new MuiPlayer({ container: this.$refs.muiPlayer,
container: this.$refs.muiPlayer, live: true,
live: true, src: this.url,
src: this.url, autoplay: true,
autoplay: true, muted: true,
muted: true, parse: parse,
parse: parse, pageHead: false,
pageHead: false, width: '100%',
width: '100%', height: '100%',
height: '100%', autoFit: false,
autoFit:false, objectFit: 'contain',
objectFit: 'contain', videoAttribute: [
videoAttribute: [
{
attrKey: 'webkit-playsinline',
attrValue: 'webkit-playsinline',
},
{
attrKey: 'playsinline',
attrValue: 'playsinline',
},
{
attrKey: 'x5-video-player-type',
attrValue: 'h5-page',
},
],
custom: {
footerControls: [
{ {
style: {}, attrKey: 'webkit-playsinline',
attrValue: 'webkit-playsinline',
},
{
attrKey: 'playsinline',
attrValue: 'playsinline',
},
{
attrKey: 'x5-video-player-type',
attrValue: 'h5-page',
}, },
], ],
}, custom: {
}) footerControls: [
let _video = this.mp.video() {
style: {},
this.$nextTick(() => { },
this.mp.on('ready', (event) => { ],
_video.play() },
_video.addEventListener('play', (e) => { })
// let _video = this.mp.video()
this.$emit('onPlayFn')
}) this.$nextTick(() => {
_video.addEventListener('ended', (e) => { this.mp.on('ready', (event) => {
// _video.play()
this.$emit('onEndedFn') _video.addEventListener('play', (e) => {
//
this.$emit('onPlayFn')
})
_video.addEventListener('ended', (e) => {
//
this.$emit('onEndedFn')
})
}) })
}) })
}) }
}, },
}, },
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<view> <view class="h-full w-full">
<LiveVideo <LiveVideo
v-if="address" v-if="address"
:key="address" :key="address"

View File

@ -185,7 +185,7 @@ export default {
}, },
}, },
{ {
field: 'type', field: 'industry',
label: '农业类型', label: '农业类型',
component: 'ApiSelect', component: 'ApiSelect',
componentProps: ({ formActionType }) => { componentProps: ({ formActionType }) => {
@ -197,7 +197,7 @@ export default {
return data.data return data.data
}, },
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'key',
} }
}, },
}, },

View File

@ -157,7 +157,7 @@ export default {
}, },
}, },
{ {
field: 'type', field: 'industry',
label: '农业类型', label: '农业类型',
component: 'ApiSelect', component: 'ApiSelect',
componentProps: ({ formActionType }) => { componentProps: ({ formActionType }) => {
@ -169,7 +169,7 @@ export default {
return data.data return data.data
}, },
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'key',
} }
}, },
}, },
@ -178,15 +178,15 @@ export default {
}, },
computed: { computed: {
options() { options() {
return [ return [].filter((e) => checkPermission(e.permission))
].filter((e) => checkPermission(e.permission))
}, },
}, },
methods: { methods: {
handleSubmit(e) { handleSubmit(e) {
this.filterParmas = e this.filterParmas = e
this.mescroll.resetUpScroll() this.$nextTick(() => {
this.mescroll.resetUpScroll()
})
}, },
upCallback({ num, size }) { upCallback({ num, size }) {
this.getData({ this.getData({

View File

@ -135,7 +135,7 @@
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="video_ul" v-show="current == 0"> <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"> <view class="video_cd">
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<!-- {{ video.video_url }} --> <!-- {{ video.video_url }} -->
@ -165,7 +165,7 @@
<view <view
class="video_li" class="video_li"
v-for="(video, index) in videoList2" v-for="(video, index) in videoList2"
:key="video.video_url+index" :key="index+'s2'"
> >
<view class="video_cd"> <view class="video_cd">
<!-- #ifdef H5 --> <!-- #ifdef H5 -->