From 91d0582df09049e9a5b5f729995f68fdfd233f69 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Tue, 20 Nov 2018 12:43:30 -0600 Subject: [PATCH] Add resolution display to publisher and subscriber. --- app/common.js | 8 ++++++++ app/index.html | 3 ++- app/publish.html | 3 ++- package.json | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/common.js b/app/common.js index 720b4f3..b01dd7c 100644 --- a/app/common.js +++ b/app/common.js @@ -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 { diff --git a/app/index.html b/app/index.html index feee19a..386cebb 100644 --- a/app/index.html +++ b/app/index.html @@ -11,7 +11,8 @@ - + diff --git a/app/publish.html b/app/publish.html index cb0ad1c..01c51b8 100644 --- a/app/publish.html +++ b/app/publish.html @@ -26,7 +26,8 @@ - + diff --git a/package.json b/package.json index 5062ca8..8deccec 100644 --- a/package.json +++ b/package.json @@ -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": {
Channel: + ?x?
Channel: + ?x?
Password: