File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 55 < meta charset ="utf-8 ">
66 < title > </ title >
77 < script src ="https://cdn.jsdelivr.net/npm/gun/gun.js "> </ script >
8- < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.7 /js/GunRecorder.js "> </ script >
9- < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.7 /js/GunStreamer.js "> </ script >
10- < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.7 /js/GunViewer.js "> </ script >
11- < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.7 /js/mediabuffer.js "> </ script >
8+ < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.8 /js/GunRecorder.js "> </ script >
9+ < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.8 /js/GunStreamer.js "> </ script >
10+ < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.8 /js/GunViewer.js "> </ script >
11+ < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.8 /js/mediabuffer.js "> </ script >
1212</ head >
1313
1414< body >
2222 < br >
2323 Viewer< br >
2424 < video id ="remote " width ="20% " autoplay muted > </ video >
25- < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.7 /js/integration.js "> </ script >
25+ < script src ="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.8 /js/integration.js "> </ script >
2626</ body >
2727
2828</ html >
Original file line number Diff line number Diff line change @@ -76,9 +76,13 @@ class GunRecorder {
7676 }
7777 var gunRecorder = this ;
7878 if ( navigator . mediaDevices . getDisplayMedia && navigator . mediaDevices . getDisplayMedia ) {
79- navigator . mediaDevices . getDisplayMedia ( this . cameraOptions ) . then ( function ( stream ) {
80- gunRecorder . video . srcObject = stream ;
81- gunRecorder . video . play ( ) ;
79+ navigator . mediaDevices . getDisplayMedia ( this . cameraOptions ) . then ( function ( desktopStream ) {
80+ navigator . mediaDevices . getUserMedia ( { video : false , audio : true } ) . then ( function ( voiceStream ) {
81+ let tracks = [ desktopStream . getVideoTracks ( ) [ 0 ] , voiceStream . getAudioTracks ( ) [ 0 ] ]
82+ var stream = new MediaStream ( tracks ) ;
83+ gunRecorder . video . srcObject = stream ;
84+ gunRecorder . video . play ( ) ;
85+ } ) ;
8286 } ) ;
8387 this . setRecordingState ( recordSate . STOPPED ) ;
8488 } else {
You can’t perform that action at this time.
0 commit comments