Skip to content

Commit d208939

Browse files
committed
Aligned to changes in Streaming plugin configuration
2 parents c2dbb17 + 6063771 commit d208939

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

conf/janus.plugin.streaming.jcfg.sample.in

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
# To test the 'gstreamer-sample' example, check the test_gstreamer.sh
7878
# script in the plugins/streams folder. The live and on-demand audio
7979
# file streams, use a couple of files (radio.alaw, music.mulaw) that are
80-
# provided in the plugins/streams folder.
80+
# provided in the plugins/streams folder.
8181
#}
8282

8383
general: {
@@ -123,10 +123,13 @@ file-ondemand-sample: {
123123
}
124124

125125
#
126-
# Firefox Nightly supports H.264 through Cisco's OpenH264 plugin. The only
127-
# supported profile is the baseline one. This is an example of how to create
128-
# a H.264 mountpoint: one way to feed it is via an x264enc+rtph264pay
129-
# pipeline in gstreamer.
126+
# All browsers also support H.264, often through Cisco's OpenH264 plugin.
127+
# The only profile that is definitely supported is the baseline one, which
128+
# means that if you try a higher one it might or might not work. No matter
129+
# which profile you encode, though, you can put a custom one in the SDP if
130+
# you override the fmtp SDP attribute via 'videofmtp'. The following is an
131+
# example of how to create a simple H.264 mountpoint: you can feed it via
132+
# an x264enc+rtph264pay pipeline in gstreamer, an ffmpeg script or other.
130133
#
131134
#h264-sample: {
132135
#type = "rtp"
@@ -140,6 +143,25 @@ file-ondemand-sample: {
140143
#videofmtp = "profile-level-id=42e01f;packetization-mode=1"
141144
#}
142145

146+
#
147+
# The Streaming plugin also supports the broadcasting of datachannel
148+
# messages, either by themselves or along other audio/video streams (e.g.,
149+
# to add a subtitle to a stream you're sending). The following is an
150+
# example of how you can create a datachannel-only mountpoint: you can
151+
# feed it with any tool that can send UDP datagrams, e.g., netcat.
152+
# Notice that the 'rtp' type just indicates this is a live mountpoint:
153+
# datachannel messages will be sent as usual, and not use RTP at all.
154+
#
155+
#data-example: {
156+
#type = rtp
157+
#id = 15
158+
#description = Datachannel stream from an UDP source
159+
#audio = false
160+
#video = false
161+
#data = true
162+
#dataport = 5008
163+
#}
164+
143165
#
144166
# This is a sample configuration for Opus/VP8 multicast streams. You
145167
# need an external script to feed data on those ports, of course.

html/streamingtest.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ $(document).ready(function() {
151151
streaming.createAnswer(
152152
{
153153
jsep: jsep,
154-
media: { audioSend: false, videoSend: false }, // We want recvonly audio/video
154+
// We want recvonly audio/video and, if negotiated, datachannels
155+
media: { audioSend: false, videoSend: false, data: true },
155156
success: function(jsep) {
156157
Janus.debug("Got SDP!");
157158
Janus.debug(jsep);
@@ -233,10 +234,25 @@ $(document).ready(function() {
233234
}, 1000);
234235
}
235236
},
237+
ondataopen: function(data) {
238+
Janus.log("The DataChannel is available!");
239+
$('#waitingvideo').remove();
240+
$('#stream').append(
241+
'<input class="form-control" type="text" id="datarecv" disabled></input>'
242+
);
243+
if(spinner !== null && spinner !== undefined)
244+
spinner.stop();
245+
spinner = null;
246+
},
247+
ondata: function(data) {
248+
Janus.debug("We got data from the DataChannel! " + data);
249+
$('#datarecv').val(data);
250+
},
236251
oncleanup: function() {
237252
Janus.log(" ::: Got a cleanup notification :::");
238253
$('#waitingvideo').remove();
239254
$('#remotevideo').remove();
255+
$('#datarecv').remove();
240256
$('.no-video-container').remove();
241257
$('#bitrate').attr('disabled', true);
242258
$('#bitrateset').html('Bandwidth<span class="caret"></span>');

0 commit comments

Comments
 (0)