|
@@ -57,6 +57,7 @@ import {
|
|
|
import { appEl } from '@/store';
|
|
|
import { useViewStack } from '@/hook';
|
|
|
import { currentModel } from '@/model';
|
|
|
+import { Message } from 'bill/expose-common';
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
@@ -83,6 +84,8 @@ export default defineComponent({
|
|
|
const videoRecorder = new VideoRecorder(config);
|
|
|
const showLeftPano = ref(false)
|
|
|
const showBottomBar = ref(false)
|
|
|
+ const MAX_SIZE = 2048 * 1024 * 1024
|
|
|
+ const MAX_TIME = 30 * 60 * 1000
|
|
|
|
|
|
type VideoItem = { origin: Blob | string, cover: string }
|
|
|
|
|
@@ -90,6 +93,10 @@ export default defineComponent({
|
|
|
let interval: NodeJS.Timer
|
|
|
let recordIng = ref(false)
|
|
|
const start = () => {
|
|
|
+ if (size.value > MAX_SIZE) {
|
|
|
+ return Message.warning('已超出限制大小无法继续录制,可保存后继续录制!')
|
|
|
+ }
|
|
|
+
|
|
|
showBottomBar.value = false
|
|
|
countdown.value = 2
|
|
|
const timeiffe = () => {
|
|
@@ -123,12 +130,13 @@ export default defineComponent({
|
|
|
|
|
|
watchEffect((onCleanup) => {
|
|
|
if (recordIng.value) {
|
|
|
- const timeout = setTimeout(pause, 30 * 60 * 1000)
|
|
|
+ const timeout = setTimeout(pause, (MAX_TIME * size.value) / MAX_SIZE)
|
|
|
onCleanup(() => clearTimeout(timeout))
|
|
|
}
|
|
|
})
|
|
|
|
|
|
const blobs: File[] = shallowReactive([])
|
|
|
+ const size = computed(() => blobs.reduce((t, f) => t + f.size, 0))
|
|
|
videoRecorder.off('*')
|
|
|
videoRecorder.on('record', blob => {
|
|
|
blobs.push(new File([blob], '录屏.mp4', { type: 'video/mp4; codecs=h264' }))
|