Skip to content

Commit

Permalink
Add resolution display to publisher and subscriber.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Nov 20, 2018
1 parent ebf9385 commit 91d0582
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ function setVideoSource(video, streamOrUrl) {
stream = streamOrUrl;
whenStreamIsActive(function getStream() { return stream }, setSrc);
function setSrc() {
var res = document.querySelector('#res');
if (res) {
res.innerHTML = '?x?';
video.oncanplay = function canPlay() {
res.innerHTML = video.videoWidth + 'x' + video.videoHeight;
};
}

console.log('adding active video stream');
video.style.background = 'black';
try {
Expand Down
3 changes: 2 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<table class="params">
<tr>
<th>Channel:</th>
<td><input type="text" value="test" id="subChannel"/></td>
<td><input type="text" value="test" id="subChannel"/>
<span id="res">?x?</span></td>
<td><input type="radio" name="prof" id="profHigh" value="high" checked="checked" /><label for="profHigh">High</label></td>
</tr>
<tr>
Expand Down
3 changes: 2 additions & 1 deletion app/publish.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
</tr>
<tr>
<th>Channel:</th>
<td><input type="text" value="test" id="pubChannel"/></td>
<td><input type="text" value="test" id="pubChannel"/>
<span id="res">?x?</span></td>
</tr>
<tr>
<th>Password:</th>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mediasoup-broadcast-example",
"version": "1.2.0",
"version": "1.2.1",
"description": "Sample WebRTC broadcast client/server for the Mediasoup SFU.",
"main": "server/index.js",
"scripts": {
Expand Down

0 comments on commit 91d0582

Please sign in to comment.