mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-09-27 04:36:12 +08:00
Add auto reconnect for broken MSE stream
This commit is contained in:
@@ -19,7 +19,7 @@ export class VideoRTC extends HTMLElement {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
this.DISCONNECT_TIMEOUT = 5000;
|
this.DISCONNECT_TIMEOUT = 5000;
|
||||||
this.RECONNECT_TIMEOUT = 30000;
|
this.RECONNECT_TIMEOUT = 15000;
|
||||||
|
|
||||||
this.CODECS = [
|
this.CODECS = [
|
||||||
'avc1.640029', // H.264 high 4.1 (Chromecast 1st and 2nd Gen)
|
'avc1.640029', // H.264 high 4.1 (Chromecast 1st and 2nd Gen)
|
||||||
@@ -248,6 +248,11 @@ export class VideoRTC extends HTMLElement {
|
|||||||
|
|
||||||
this.appendChild(this.video);
|
this.appendChild(this.video);
|
||||||
|
|
||||||
|
this.video.addEventListener('error', ev => {
|
||||||
|
console.warn(ev);
|
||||||
|
if (this.ws) this.ws.close(); // run reconnect for broken MSE stream
|
||||||
|
});
|
||||||
|
|
||||||
// all Safari lies about supported audio codecs
|
// all Safari lies about supported audio codecs
|
||||||
const m = window.navigator.userAgent.match(/Version\/(\d+).+Safari/);
|
const m = window.navigator.userAgent.match(/Version\/(\d+).+Safari/);
|
||||||
if (m) {
|
if (m) {
|
||||||
|
Reference in New Issue
Block a user