()
| 102 | * 录制button状态转换 |
| 103 | */ |
| 104 | function toggleRecording() { |
| 105 | if (recordButton.textContent === 'Start Recording') { |
| 106 | startRecording(); |
| 107 | } else { |
| 108 | stopRecording(); |
| 109 | recordButton.textContent = 'Start Recording'; |
| 110 | playButton.disabled = false; |
| 111 | downloadButton.disabled = false; |
| 112 | |
| 113 | let test = document.getElementById('test') as HTMLVideoElement; |
| 114 | let buffer = new Blob(recordedBlobs, { |
| 115 | type: 'video/webm' |
| 116 | }); |
| 117 | test.src = window.URL.createObjectURL(buffer); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /* 开始录制 */ |
| 122 | function startRecording() { |
nothing calls this directly
no test coverage detected