Merge pull request #1939 from bbaldino/edge_fixes

few tweaks to fix some exceptions in edge
This commit is contained in:
virtuacoplenny 2017-08-28 15:56:04 -07:00 committed by GitHub
commit 77e8c75795
2 changed files with 14 additions and 3 deletions

View File

@ -626,8 +626,11 @@ export class VideoContainer extends LargeContainer {
// the environment words the report. To reduce the risk of scaring a
// developer, make sure that the rejection is handled. We cannot really
// do anything substantial about the rejection and, more importantly, we
// do not care.
this.$videoBackground[0].play()
.catch(reason => logger.error(reason));
// do not care. Some browsers (at this time, only Edge is known) don't
// return a promise from .play(), so check before trying to catch.
const res = this.$videoBackground[0].play();
if (typeof res !== 'undefined') {
res.catch(reason => logger.error(reason));
}
}
}

View File

@ -476,6 +476,10 @@ class ConnectionStatsTable extends Component {
* @returns {string}
*/
function getIP(value) {
if (!value) {
return '';
}
return value.substring(0, value.lastIndexOf(':'));
}
@ -488,6 +492,10 @@ function getIP(value) {
* @returns {string}
*/
function getPort(value) {
if (!value) {
return '';
}
return value.substring(value.lastIndexOf(':') + 1, value.length);
}