Skip to content

Commit

Permalink
Disable datachannel for WebRTC ingestion and remove remote-view in in…
Browse files Browse the repository at this point in the history
…gestion mode
  • Loading branch information
sirknightj committed Oct 18, 2023
1 parent 9067e90 commit 19e2e7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ function onStop() {
if (ROLE === 'master') {
stopMaster();
$('#master').addClass('d-none');
$('#master .remote-view').removeClass('d-none');
$('#master .remote').removeClass('d-none');
} else {
stopViewer();
$('#viewer').addClass('d-none');
Expand Down
4 changes: 2 additions & 2 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ <h2>Master</h2>
<h5>Master Section</h5>
<div class="video-container"><video class="local-view" autoplay playsinline controls muted></video></div>
</div>
<div id="viewer-view-holder" class="col">
<div id="viewer-view-holder" class="col remote">
<h5>Viewer Return Channel</h5>
<div id="empty-video-placeholder" class="video-container"><video class="remote-view" autoplay playsinline controls></video></div>
</div>
Expand All @@ -291,7 +291,7 @@ <h5>Viewer Return Channel</h5>
<textarea type="text" class="form-control local-message" placeholder="DataChannel message to send to all viewers"> </textarea>
</div>
</div>
<div class="col">
<div class="col remote">
<div class="card bg-light mb-3">
<pre class="remote-message card-body text-monospace preserve-whitespace"></pre>
</div>
Expand Down
7 changes: 7 additions & 0 deletions examples/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ async function startMaster(localView, remoteView, formValues, onStatsReport, onR
protocols.push('WEBRTC');
master.streamARN = mediaStorageConfiguration.StreamARN;
console.log(`[MASTER] Using media ingestion feature. Stream ARN: ${master.streamARN}`);

$('#master .remote').addClass('d-none');
if (formValues.openDataChannel) {
console.warn('[MASTER] DataChannel is not enabled for WebRTC ingestion. Overriding value to false.');
formValues.openDataChannel = false;
$('.datachannel').addClass('d-none');
}
} else {
console.log('[MASTER] Not using media ingestion feature.');
master.streamARN = null;
Expand Down

0 comments on commit 19e2e7f

Please sign in to comment.