| | |
| | | <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) |
| | |
| | | text: '', |
| | | // background: "bg.jpg", |
| | | loadingText: '加载中', |
| | | controlAutoHide: true, |
| | | // hasAudio:false, |
| | | debug: true, |
| | | showBandwidth: showBandwidth.value, // 显示网速 |
| | |
| | | |
| | | jessibuca.on('timeout', function () { |
| | | console.log('timeout') |
| | | emits('timeout') |
| | | }) |
| | | |
| | | jessibuca.on('start', function () { |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | | <style scoped lang="scss"></style> |