Embed: WebRTC: add loading icon while attempting to connect

This commit is contained in:
Cat 2021-02-23 12:35:01 +01:00 committed by Thulinma
parent 6204a57a0e
commit 0cd4ae17b7
3 changed files with 6 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -6,7 +6,7 @@
"minimize": "./minimize_internal.sh" "minimize": "./minimize_internal.sh"
}, },
"dependencies": { "dependencies": {
"clean-css-cli": "^4.2.1", "clean-css-cli": "^4.3.0",
"terser": "^3.17.0" "terser": "^3.17.0"
} }
} }

View file

@ -234,6 +234,7 @@ p.prototype.build = function (MistVideo,callback) {
this.connect = function(callback){ this.connect = function(callback){
thisWebRTCPlayer.isConnecting = true; thisWebRTCPlayer.isConnecting = true;
MistVideo.container.setAttribute("data-loading","connecting"); //show loading icon while setting up the connection
//chrome on android has a bug where H264 is not available immediately after the tab is opened: https://bugs.chromium.org/p/webrtc/issues/detail?id=11620 //chrome on android has a bug where H264 is not available immediately after the tab is opened: https://bugs.chromium.org/p/webrtc/issues/detail?id=11620
//this workaround tries 5x with 100ms intervals before continuing //this workaround tries 5x with 100ms intervals before continuing
@ -288,11 +289,13 @@ p.prototype.build = function (MistVideo,callback) {
MistVideo.nextCombo(); MistVideo.nextCombo();
break; break;
} }
case "connected": {
MistVideo.container.removeAttribute("data-loading");
}
case "disconnected": case "disconnected":
case "closed": case "closed":
case "new": case "new":
case "connecting": case "connecting":
case "connected":
default: { default: {
MistVideo.log("WebRTC connection state changed to "+this.connectionState); MistVideo.log("WebRTC connection state changed to "+this.connectionState);
break; break;