From 54849757852f6ab40eb17afbd03d1d839b60a38d Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 13 Nov 2023 17:09:15 +0800
Subject: [PATCH] 重复定时和连续执行
---
src/components/Jessibuca/Jessibuca.vue | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/components/Jessibuca/Jessibuca.vue b/src/components/Jessibuca/Jessibuca.vue
index 3591523..2a98fc4 100644
--- a/src/components/Jessibuca/Jessibuca.vue
+++ b/src/components/Jessibuca/Jessibuca.vue
@@ -1,22 +1,25 @@
<template>
- <div>
- <div class="root">
- <div class="container-shell">
- <div id="container" ref="container" style="width:200px;height:200px"></div>
- </div>
- </div>
- </div>
+ <div id="container" ref="container" :style="{width,height}"></div>
</template>
<script setup lang="ts">
-import { onMounted, onUnmounted, ref, defineProps } from 'vue'
+import { onMounted, onUnmounted, ref, defineProps, defineEmits } from 'vue'
import Jessibuca from '../../../public/jessibuca/jessibuca'
const props = defineProps({
videoUrl: {
type: String,
required: true
+ },
+ width: {
+ type: String,
+ default: '300px'
+ },
+ height: {
+ type: String,
+ default: '200px'
}
})
+const emits = defineEmits(['timeout'])
let jessibuca: null | Jessibuca = null
const container = ref(null)
const buffer = ref(null)
@@ -35,6 +38,7 @@
text: '',
// background: "bg.jpg",
loadingText: '加载中',
+ controlAutoHide: true,
// hasAudio:false,
debug: true,
showBandwidth: showBandwidth.value, // 显示网速
@@ -104,6 +108,7 @@
jessibuca.on('timeout', function () {
console.log('timeout')
+ emits('timeout')
})
jessibuca.on('start', function () {
@@ -171,4 +176,4 @@
}
</script>
-<style scoped></style>
+<style scoped lang="scss"></style>
--
Gitblit v1.9.3