diff options
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index 533ee1bb8..5db7a2e55 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts | |||
@@ -133,13 +133,23 @@ export class PeertubePlayerManager { | |||
133 | offlineNotificationElem.classList.add('vjs-peertube-offline-notification') | 133 | offlineNotificationElem.classList.add('vjs-peertube-offline-notification') |
134 | offlineNotificationElem.innerText = player.localize('You seem to be offline and the video may not work') | 134 | offlineNotificationElem.innerText = player.localize('You seem to be offline and the video may not work') |
135 | 135 | ||
136 | let offlineNotificationElemAdded = false | ||
137 | |||
136 | const handleOnline = () => { | 138 | const handleOnline = () => { |
139 | if (!offlineNotificationElemAdded) return | ||
140 | |||
137 | player.el().removeChild(offlineNotificationElem) | 141 | player.el().removeChild(offlineNotificationElem) |
142 | offlineNotificationElemAdded = false | ||
143 | |||
138 | logger.info('The browser is online') | 144 | logger.info('The browser is online') |
139 | } | 145 | } |
140 | 146 | ||
141 | const handleOffline = () => { | 147 | const handleOffline = () => { |
148 | if (offlineNotificationElemAdded) return | ||
149 | |||
142 | player.el().appendChild(offlineNotificationElem) | 150 | player.el().appendChild(offlineNotificationElem) |
151 | offlineNotificationElemAdded = true | ||
152 | |||
143 | logger.info('The browser is offline') | 153 | logger.info('The browser is offline') |
144 | } | 154 | } |
145 | 155 | ||