Skip to content

Commit 6870061

Browse files
Replay data channel recordings (#2468)
1 parent 2322dbb commit 6870061

File tree

2 files changed

+190
-30
lines changed

2 files changed

+190
-30
lines changed

html/recordplaytest.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ $(document).ready(function() {
147147
recordplay.createAnswer(
148148
{
149149
jsep: jsep,
150-
media: { audioSend: false, videoSend: false }, // We want recvonly audio/video
150+
media: { audioSend: false, videoSend: false, data: true }, // We want recvonly audio/video
151151
success: function(jsep) {
152152
Janus.debug("Got SDP!", jsep);
153153
var body = { request: "start" };
@@ -314,6 +314,16 @@ $(document).ready(function() {
314314
$('#thevideo').removeClass('hide').show();
315315
}
316316
},
317+
ondataopen: function(data) {
318+
Janus.log("The DataChannel is available!");
319+
$('#videobox').append(
320+
'<input class="form-control" type="text" id="datarecv" disabled></input>'
321+
);
322+
},
323+
ondata: function(data) {
324+
Janus.debug("We got data from the DataChannel!", data);
325+
$('#datarecv').val(data);
326+
},
317327
oncleanup: function() {
318328
Janus.log(" ::: Got a cleanup notification :::");
319329
// FIXME Reset status

0 commit comments

Comments
 (0)