gemercheung 3 年之前
父节点
当前提交
2b855fc429
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 6 1
      packages/core/src/lib/basicSimaqRecorder.ts
  2. 6 3
      play/src/App.vue

+ 6 - 1
packages/core/src/lib/basicSimaqRecorder.ts

@@ -16,6 +16,8 @@ export interface PlatformConfigType {
     minHeight?: number;
     maxHeight?: number;
     frameRate?: number;
+    maxFrameRate?: number;
+    minFrameRate?: number;
 }
 
 export interface InitConfigType extends DisplayMediaStreamConstraints {
@@ -189,7 +191,6 @@ export class BasicSimaqRecorder extends EventEmitter {
                 }
                 console.log('eletron-audioInput', audioInput);
                 if (navigator.mediaDevices.getDisplayMedia) {
-
                     const videoConfig = {
                         mandatory: {
                             chromeMediaSource: 'desktop',
@@ -198,6 +199,10 @@ export class BasicSimaqRecorder extends EventEmitter {
                             maxWidth: this.platformConfig.maxWidth || 3840,
                             minHeight: this.platformConfig.minHeight || 720,
                             maxHeight: this.platformConfig.maxHeight || 2160,
+                            maxFrameRate:
+                                this.platformConfig.maxFrameRate || 30,
+                            minFrameRate:
+                                this.platformConfig.minFrameRate || 30,
                         },
                     };
                     console.log('videoConfig', videoConfig);

+ 6 - 3
play/src/App.vue

@@ -10,10 +10,13 @@ import { onMounted } from 'vue';
 const videoRecorder = new VideoRecorder({
     // uploadUrl: '',
     resolution: '4k',
-    autoDownload: true,
-    platform: 'canvas',
+    autoDownload: false,
+    platform: 'electron',
     config: {
-        canvasId: '.goldplay__screen--canvas',
+        maxHeight: 1080,
+        minHeight: 1080,
+        maxWidth: 1920,
+        minWidth: 1920,
     },
     debug: false,
 });