From 712e0d3e3b68f087e9309f0f19b975bd1c47aaef Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 29 Jun 2020 02:26:41 -0500 Subject: [PATCH] Fix camera stream not connecting (#6271) The timeout to start a camera stream was 10s. With buffering it can take around 8-10s for camera to be able to send a stream. If the time it took was longer than 10s the stream would never connect in the UI. --- package.json | 2 +- src/components/ha-camera-stream.ts | 3 +++ yarn.lock | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 00f19210a4..87a988abf4 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "fecha": "^4.2.0", "fuse.js": "^6.0.0", "google-timezones-json": "^1.0.2", - "hls.js": "^0.12.4", + "hls.js": "^0.13.2", "home-assistant-js-websocket": "^5.4.1", "idb-keyval": "^3.2.0", "intl-messageformat": "^8.3.9", diff --git a/src/components/ha-camera-stream.ts b/src/components/ha-camera-stream.ts index 592e020a54..89d1330234 100644 --- a/src/components/ha-camera-stream.ts +++ b/src/components/ha-camera-stream.ts @@ -178,6 +178,9 @@ class HaCameraStream extends LitElement { ) { const hls = new Hls({ liveBackBufferLength: 60, + fragLoadingTimeOut: 30000, + manifestLoadingTimeOut: 30000, + levelLoadingTimeOut: 30000, }); this._hlsPolyfillInstance = hls; hls.attachMedia(videoEl); diff --git a/yarn.lock b/yarn.lock index 9c72bc22ce..06be65a121 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6666,10 +6666,10 @@ he@1.2.0, he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hls.js@^0.12.4: - version "0.12.4" - resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-0.12.4.tgz#c155b7b2825a11117c111b781973c0ffa759006b" - integrity sha512-e8OPxQ60dBVsdkv4atdxR21KzC1mgwspM41qpozpj3Uv1Fz4CaeQy3FWoaV2O+QKKbNRvV5hW+/LipCWdrwnMQ== +hls.js@^0.13.2: + version "0.13.2" + resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-0.13.2.tgz#3e7dd28e3787c69c6aba42b64b11eb2c3c8c29f1" + integrity sha512-sIg2t4uGpWQLzuK1Iid9614WOKqxj4OYg+EbFbhhTDCsxpENBN+Du3yBFnoi+a83DuOOHdiQd1ydnti9loSGXw== dependencies: eventemitter3 "3.1.0" url-toolkit "^2.1.6"