(stream)
| 50 | } |
| 51 | |
| 52 | function handleSuccess(stream) { |
| 53 | console.log(stream); |
| 54 | stream.onremovetrack = () => { |
| 55 | // Click on browser UI stop sharing button |
| 56 | alert('Recording has ended'); |
| 57 | }; |
| 58 | trace('getUserMedia() got stream!'); |
| 59 | recordButton.disabled = false; |
| 60 | window.stream = stream; // 录制视频的时候要用到 |
| 61 | localStream = stream; |
| 62 | localVideo.srcObject = stream; |
| 63 | // 点击录制视频的按钮 |
| 64 | document.getElementById('record').click(); |
| 65 | } |
| 66 | |
| 67 | function handleError(error) { |
| 68 | // 点击暂停按钮 |