Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replay data channel recordings #2468

Merged
merged 11 commits into from
Dec 7, 2020
12 changes: 11 additions & 1 deletion html/recordplaytest.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ $(document).ready(function() {
recordplay.createAnswer(
{
jsep: jsep,
media: { audioSend: false, videoSend: false }, // We want recvonly audio/video
media: { audioSend: false, videoSend: false, data: true }, // We want recvonly audio/video
success: function(jsep) {
Janus.debug("Got SDP!", jsep);
var body = { request: "start" };
Expand Down Expand Up @@ -314,6 +314,16 @@ $(document).ready(function() {
$('#thevideo').removeClass('hide').show();
}
},
ondataopen: function(data) {
Janus.log("The DataChannel is available!");
$('#videobox').append(
'<input class="form-control" type="text" id="datarecv" disabled></input>'
);
},
ondata: function(data) {
Janus.debug("We got data from the DataChannel!", data);
$('#datarecv').val(data);
},
oncleanup: function() {
Janus.log(" ::: Got a cleanup notification :::");
// FIXME Reset status
Expand Down
Loading