Skip to content

Commit

Permalink
Use gun to stream video and release v 0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
QVDev committed Sep 18, 2019
1 parent 552e3dd commit 40ae677
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
<head>
<meta charset="utf-8">
<title></title>
<script src="js/GunRecorder.js"></script>
<script src="js/GunStreamer.js"></script>
<script src="js/GunViewer.js"></script>
<script src="js/mediabuffer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
<script src="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.4/js/GunRecorder.js"></script>
<script src="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.4/js/GunStreamer.js"></script>
<script src="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.4/js/GunViewer.js"></script>
<script src="https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.4/js/mediabuffer.js"></script>
</head>

<body>
<button type="button" onclick="gunRecorder.startCamera()">Start Camera</button>
<button id="record_button" type="button" onclick="gunRecorder.record()">Start Recording</button>
<br><br>
Streamer<br>
<video id="record_video" width="20%" poster="https://www.srsd.net/images/video-poster.png" autoplay muted></video>
<video id="record_video" width="20%" autoplay muted></video>
<br>
<br>
Viewer<br>
<video id="qvdev" width="20%" poster="https://www.srsd.net/images/video-poster.png" autoplay muted></video>
<video id="qvdev" width="20%" autoplay muted></video>
<script src="js/integration.js"></script>
</body>

Expand Down
14 changes: 7 additions & 7 deletions js/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ 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
Expand All @@ -27,8 +27,8 @@ var streamer_config = {
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
url: "https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.2/js/parser_worker.js"//webworker load remote
// onStreamerData: gunViewer.onStreamerData,//If you want manually handle the data manually
url: "https://cdn.jsdelivr.net/gh/QVDev/GunStreamer@0.0.4/js/parser_worker.js"//webworker load remote
}

//GUN Streamer is the data side. It will convert data and write to GUN db
Expand Down

0 comments on commit 40ae677

Please sign in to comment.