-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add screencast and small improvment for configuration
- Loading branch information
Showing
5 changed files
with
71 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,15 @@ | |
<meta charset="utf-8"> | ||
<title></title> | ||
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].6/js/GunRecorder.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].6/js/GunStreamer.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].6/js/GunViewer.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].6/js/mediabuffer.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].7/js/GunRecorder.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].7/js/GunStreamer.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].7/js/GunViewer.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/QVDev/[email protected].7/js/mediabuffer.js"></script> | ||
</head> | ||
|
||
<body> | ||
<button type="button" onclick="gunRecorder.startCamera()">Start Camera</button> | ||
<button type="button" onclick="gunRecorder.startScreenCapture()">Start ScreenCapture</button> | ||
<button id="record_button" type="button" onclick="gunRecorder.record()">Start Recording</button> | ||
<br><br> | ||
Streamer<br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
const MIMETYPE_VIDEO_AUDIO = 'video/webm; codecs="opus,vp8"'; | ||
const MIMETYPE_VIDEO_ONLY = 'video/webm; codecs="vp8"'; | ||
const MIMETYPE_AUDIO_ONLY = 'video/webm; codecs="opus"'; | ||
|
||
const MIME_TYPE_USE = MIMETYPE_VIDEO_ONLY; | ||
|
||
//Config for camera recorder | ||
const CAMERA_OPTIONS = { | ||
video: { | ||
width: 320, | ||
height: 280, | ||
facingMode: "environment", | ||
frameRate: 16 | ||
}, audio: false//Enable for sound make sure to change the MIME type to AUDIO_VIDEO | ||
} | ||
|
||
|
||
//Configure GunViewer | ||
var viewer_config = { | ||
mimeType: MIMETYPE_VIDEO_ONLY, | ||
mimeType: MIME_TYPE_USE, | ||
streamerId: "qvdev",//ID of the streamer | ||
catchup: true,//Skip to last frame when there is to much loading. Set to false to increase smooth playback but with latency | ||
debug: false,//For debug logs | ||
} | ||
|
||
|
@@ -13,21 +28,21 @@ var gunViewer = new GunViewer(viewer_config); | |
//Configure GUN to pass to streamer | ||
var peers = ['https://gunmeetingserver.herokuapp.com/gun']; | ||
var opt = { peers: peers, localStorage: false, radisk: false }; | ||
var gunDB = Gun(opt); | ||
// var gunDB = Gun(opt); | ||
|
||
// Get data from gun and pass along to viewer | ||
gunDB.get("qvdev").on(function (data) { | ||
gunViewer.onStreamerData(data); | ||
}); | ||
// // Get data from gun and pass along to viewer | ||
// gunDB.get("qvdev").on(function (data) { | ||
// gunViewer.onStreamerData(data); | ||
// }); | ||
|
||
|
||
//Config for the GUN GunStreamer | ||
var streamer_config = { | ||
dbRecord: "gunmeeting",//The root of the streams | ||
streamId: "qvdev",//The user id you wanna stream | ||
gun: gunDB,//Gun instance | ||
streamId: "qvdev",//The user id you wanna stream | ||
// gun: gunDB,//Gun instance | ||
debug: false,//For debug logs | ||
// onStreamerData: gunViewer.onStreamerData,//If you want manually handle the data manually | ||
onStreamerData: gunViewer.onStreamerData,//If you want manually handle the data manually | ||
url: "https://cdn.jsdelivr.net/gh/QVDev/[email protected]/js/parser_worker.js"//webworker load remote | ||
} | ||
|
||
|
@@ -51,14 +66,15 @@ var onRecordStateChange = function (state) { | |
} | ||
} | ||
|
||
//Config for the gun recorder | ||
var recorder_config = { | ||
mimeType: MIMETYPE_VIDEO_ONLY, | ||
mimeType: MIME_TYPE_USE, | ||
video_id: "record_video",//Video html element id | ||
onDataAvailable: gunStreamer.onDataAvailable,//MediaRecorder data available callback | ||
onRecordStateChange: onRecordStateChange,//Callback for recording state | ||
audioBitsPerSecond: 6000,//Audio bits per second this is the lowest quality | ||
videoBitsPerSecond: 100000,//Video bits per second this is the lowest quality | ||
recordInterval: 150,//Interval of the recorder higher will increase delay but more buffering. Lower will not do much. Due limitiation of webm | ||
cameraOptions: CAMERA_OPTIONS,//The camera and screencast options see constant | ||
experimental: true,//This is custom time interval and very unstable with audio. Only video is more stable is interval quick enough? Audio | ||
debug: false//For debug logs | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters