Merge pull request '引入新插件解决视频保存问题' (#3) from yj into master
Reviewed-on: #3
This commit is contained in:
commit
1c92406b1c
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "WGShare.Metting",
|
"name": "WGShare.Metting",
|
||||||
"version": "0.0.1",
|
"version": "0.1.14",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "WGShare.Metting",
|
"name": "WGShare.Metting",
|
||||||
"version": "0.0.1",
|
"version": "0.1.14",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^5.3.7",
|
"@ant-design/icons": "^5.3.7",
|
||||||
"@microsoft/signalr": "^8.0.0",
|
"@microsoft/signalr": "^8.0.0",
|
||||||
|
|
@ -28,7 +28,8 @@
|
||||||
"react-redux": "^9.1.2",
|
"react-redux": "^9.1.2",
|
||||||
"react-router-dom": "^6.23.1",
|
"react-router-dom": "^6.23.1",
|
||||||
"sass": "^1.77.5",
|
"sass": "^1.77.5",
|
||||||
"tldraw": "^2.2.0"
|
"tldraw": "^2.2.0",
|
||||||
|
"webm-duration-fix-buffer": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^17.0.33",
|
"@types/react": "^17.0.33",
|
||||||
|
|
@ -5043,6 +5044,11 @@
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ebml-block": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/ebml-block/-/ebml-block-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-HgNlIsRFP6D9VKU5atCeHRJY7XkJP8bOe8yEhd8NB7B3b4++VWTyauz6g650iiPmLfPLGlVpoJmGSgMfXDYusg=="
|
||||||
|
},
|
||||||
"node_modules/ejs": {
|
"node_modules/ejs": {
|
||||||
"version": "3.1.10",
|
"version": "3.1.10",
|
||||||
"resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz",
|
"resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz",
|
||||||
|
|
@ -5823,6 +5829,14 @@
|
||||||
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
||||||
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
|
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
|
||||||
},
|
},
|
||||||
|
"node_modules/events": {
|
||||||
|
"version": "3.3.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/events/-/events-3.3.0.tgz",
|
||||||
|
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/eventsource": {
|
"node_modules/eventsource": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-2.0.2.tgz",
|
"resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-2.0.2.tgz",
|
||||||
|
|
@ -7329,6 +7343,14 @@
|
||||||
"resolved": "https://registry.npmmirror.com/ini/-/ini-1.3.8.tgz",
|
"resolved": "https://registry.npmmirror.com/ini/-/ini-1.3.8.tgz",
|
||||||
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
|
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
|
||||||
},
|
},
|
||||||
|
"node_modules/int64-buffer": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/int64-buffer/-/int64-buffer-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-+3azY4pXrjAupJHU1V9uGERWlhoqNswJNji6aD/02xac7oxol508AsMC5lxKhEqyZeDFy3enq5OGWXF4u75hiw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 4.5.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/into-stream": {
|
"node_modules/into-stream": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/into-stream/-/into-stream-3.1.0.tgz",
|
"resolved": "https://registry.npmmirror.com/into-stream/-/into-stream-3.1.0.tgz",
|
||||||
|
|
@ -11977,6 +11999,17 @@
|
||||||
"resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/webm-duration-fix-buffer": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/webm-duration-fix-buffer/-/webm-duration-fix-buffer-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-y6+5MJxduGp8uoclwzbnCEpNtO9gscj39BSQwdyqDk66q9a+vb5fWhxwR5JmMhWCGlZLbP4O/p29mxjbMGPt+A==",
|
||||||
|
"dependencies": {
|
||||||
|
"buffer": "^6.0.3",
|
||||||
|
"ebml-block": "^1.1.2",
|
||||||
|
"events": "^3.3.0",
|
||||||
|
"int64-buffer": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/whatwg-url": {
|
"node_modules/whatwg-url": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
"resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||||
|
|
@ -15743,6 +15776,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ebml-block": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/ebml-block/-/ebml-block-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-HgNlIsRFP6D9VKU5atCeHRJY7XkJP8bOe8yEhd8NB7B3b4++VWTyauz6g650iiPmLfPLGlVpoJmGSgMfXDYusg=="
|
||||||
|
},
|
||||||
"ejs": {
|
"ejs": {
|
||||||
"version": "3.1.10",
|
"version": "3.1.10",
|
||||||
"resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz",
|
"resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz",
|
||||||
|
|
@ -16265,6 +16303,11 @@
|
||||||
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
||||||
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
|
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
|
||||||
},
|
},
|
||||||
|
"events": {
|
||||||
|
"version": "3.3.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/events/-/events-3.3.0.tgz",
|
||||||
|
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="
|
||||||
|
},
|
||||||
"eventsource": {
|
"eventsource": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-2.0.2.tgz",
|
"resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-2.0.2.tgz",
|
||||||
|
|
@ -17425,6 +17468,11 @@
|
||||||
"resolved": "https://registry.npmmirror.com/ini/-/ini-1.3.8.tgz",
|
"resolved": "https://registry.npmmirror.com/ini/-/ini-1.3.8.tgz",
|
||||||
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
|
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
|
||||||
},
|
},
|
||||||
|
"int64-buffer": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/int64-buffer/-/int64-buffer-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-+3azY4pXrjAupJHU1V9uGERWlhoqNswJNji6aD/02xac7oxol508AsMC5lxKhEqyZeDFy3enq5OGWXF4u75hiw=="
|
||||||
|
},
|
||||||
"into-stream": {
|
"into-stream": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/into-stream/-/into-stream-3.1.0.tgz",
|
"resolved": "https://registry.npmmirror.com/into-stream/-/into-stream-3.1.0.tgz",
|
||||||
|
|
@ -20902,6 +20950,17 @@
|
||||||
"resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||||
},
|
},
|
||||||
|
"webm-duration-fix-buffer": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/webm-duration-fix-buffer/-/webm-duration-fix-buffer-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-y6+5MJxduGp8uoclwzbnCEpNtO9gscj39BSQwdyqDk66q9a+vb5fWhxwR5JmMhWCGlZLbP4O/p29mxjbMGPt+A==",
|
||||||
|
"requires": {
|
||||||
|
"buffer": "^6.0.3",
|
||||||
|
"ebml-block": "^1.1.2",
|
||||||
|
"events": "^3.3.0",
|
||||||
|
"int64-buffer": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"whatwg-url": {
|
"whatwg-url": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
"resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@
|
||||||
"react-redux": "^9.1.2",
|
"react-redux": "^9.1.2",
|
||||||
"react-router-dom": "^6.23.1",
|
"react-router-dom": "^6.23.1",
|
||||||
"sass": "^1.77.5",
|
"sass": "^1.77.5",
|
||||||
"tldraw": "^2.2.0"
|
"tldraw": "^2.2.0",
|
||||||
|
"webm-duration-fix-buffer": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^17.0.33",
|
"@types/react": "^17.0.33",
|
||||||
|
|
@ -102,7 +103,7 @@
|
||||||
"deleteAppDataOnUninstall": true,
|
"deleteAppDataOnUninstall": true,
|
||||||
"shortcutName": "智汇享",
|
"shortcutName": "智汇享",
|
||||||
"allowElevation": true,
|
"allowElevation": true,
|
||||||
"perMachine":true
|
"perMachine": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -472,10 +472,12 @@ const User: React.FC = () => {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const file = document.createElement("input") as any;
|
const file = document.createElement("input") as any;
|
||||||
file.type = "file";
|
file.type = "file";
|
||||||
file.accept = ".xls,.xlsx";
|
// file.accept = ".xls,.xlsx";
|
||||||
file.onchange = async () => {
|
file.onchange = async () => {
|
||||||
const setting = await JSON.parse(storage.getItem('setting') as string)
|
const setting = await JSON.parse(storage.getItem('setting') as string)
|
||||||
const fileInfo = file.files[0];
|
const fileInfo = file.files[0];
|
||||||
|
console.log(fileInfo);
|
||||||
|
return
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file", fileInfo);
|
formData.append("file", fileInfo);
|
||||||
await PostUserImport(formData).then(res => {
|
await PostUserImport(formData).then(res => {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import StupWizard from '@/components/StupWizard';
|
||||||
import EquipmentManagement from '@/components/EquipmentManagement';
|
import EquipmentManagement from '@/components/EquipmentManagement';
|
||||||
import UserVideo from '@/components/UserVideo';
|
import UserVideo from '@/components/UserVideo';
|
||||||
import { role } from '@/config/role';
|
import { role } from '@/config/role';
|
||||||
|
import { fixWebmDuration } from "webm-duration-fix-buffer";
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
|
|
@ -539,15 +540,13 @@ const Meeting: React.FC = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (recorder) {
|
if (recorder) {
|
||||||
recorder.start();
|
recorder.start();
|
||||||
recorder.ondataavailable = (event: any) => {
|
recorder.ondataavailable = async (event: any) => {
|
||||||
const blob = new Blob([event.data], {
|
const blob = await fixWebmDuration(event.data);
|
||||||
type: 'video/mp4',
|
|
||||||
});
|
|
||||||
const reader = new FileReader() as any;
|
const reader = new FileReader() as any;
|
||||||
reader.onload = async () => {
|
reader.onload = async () => {
|
||||||
const setting = await JSON.parse(storage.getItem('setting') as string)
|
const setting = await JSON.parse(storage.getItem('setting') as string)
|
||||||
const buffer = Buffer.from(reader.result);
|
const buffer = Buffer.from(reader.result);
|
||||||
await fs.writeFile(`${setting.recordingFilesPath}会议录制_${state.roomName}_${state.channelId}_${+new Date()}.mp4`, buffer, {});
|
await fs.writeFile(`${setting.recordingFilesPath}会议录制_${state.roomName}_${state.channelId}_${+new Date()}.webm`, buffer, {});
|
||||||
confirm({
|
confirm({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
icon: <ExclamationCircleFilled />,
|
icon: <ExclamationCircleFilled />,
|
||||||
|
|
@ -1060,12 +1059,12 @@ const Meeting: React.FC = () => {
|
||||||
// 合并音频流与视频流
|
// 合并音频流与视频流
|
||||||
const combinedSource = new MediaStream([...stream.getVideoTracks(), ...systemSoundDestination.stream.getAudioTracks()]);
|
const combinedSource = new MediaStream([...stream.getVideoTracks(), ...systemSoundDestination.stream.getAudioTracks()]);
|
||||||
// 开始录制
|
// 开始录制
|
||||||
const recorder = new MediaRecorder(combinedSource, {
|
const mediaRecorder = new MediaRecorder(combinedSource, {
|
||||||
mimeType: 'video/webm;codecs=vp9,opus',
|
mimeType: 'video/webm;codecs=vp9,opus',
|
||||||
videoBitsPerSecond: 1.5e6,
|
videoBitsPerSecond: 1.5e6,
|
||||||
});
|
});
|
||||||
setMediaStream(combinedSource);
|
setMediaStream(combinedSource);
|
||||||
setRecorder(recorder);
|
setRecorder(mediaRecorder);
|
||||||
});
|
});
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error.code === 'ENOENT') {
|
if (error.code === 'ENOENT') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue