-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpreload.js
More file actions
35 lines (31 loc) · 1.07 KB
/
preload.js
File metadata and controls
35 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// All of the Node.js APIs are available in the preload process.
// It has the same sandbox as a Chrome extension.
// window.addEventListener('DOMContentLoaded', () => {
// for (const versionType of ['chrome', 'electron', 'node']) {
// document.getElementById(`${versionType}-version`).innerText = process.versions[versionType]
// }
// })
const fs = require('fs');
// const RecordRTC = require('./libs/rtc');
console.log(fs)
// console.log(RecordRTC)
// navigator.mediaDevices.getUserMedia({
// video: true,
// audio: true,
// }).then(async function (stream) {
// let recorder = RecordRTC(stream, {
// type: 'video/mp4'
// });
// recorder.startRecording();
// const sleep = m => new Promise(r => setTimeout(r, m));
// await sleep(3000);
// recorder.stopRecording(function () {
// let blob = recorder.getBlob();
// console.log(blob);
// fs.writeFileAsync('./test.txt', blob);
// // invokeSaveAsDialog(blob);
// });
// recorder.getDataURL((dataURL) => {
// console.log(dataURL);
// })
// });