From f2a16d93b476aff16d5353e4d44350298ec7e01c Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Wed, 28 Sep 2022 11:52:23 +0200 Subject: Handle network issues in video player (#5138) * feat(client/player): handle network offline * feat(client/player): human friendly err msg * feat(client/player): handle broken resolutions When an error occurs for a resolution, remove the resolution and try with another resolution. * fix(client/player): prevent err handl when offline * fix(client/player): localize offline text --- .../assets/player/shared/resolutions/peertube-resolutions-plugin.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'client/src/assets/player/shared/resolutions') diff --git a/client/src/assets/player/shared/resolutions/peertube-resolutions-plugin.ts b/client/src/assets/player/shared/resolutions/peertube-resolutions-plugin.ts index e7899ac71..4fafd27b1 100644 --- a/client/src/assets/player/shared/resolutions/peertube-resolutions-plugin.ts +++ b/client/src/assets/player/shared/resolutions/peertube-resolutions-plugin.ts @@ -21,6 +21,11 @@ class PeerTubeResolutionsPlugin extends Plugin { this.trigger('resolutionsAdded') } + remove (resolutionIndex: number) { + this.resolutions = this.resolutions.filter(r => r.id !== resolutionIndex) + this.trigger('resolutionRemoved') + } + getResolutions () { return this.resolutions } -- cgit v1.2.3