From 19985ff6b88d11abfa7520b0aff73a8f4ffd741b Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Tue, 31 Aug 2021 11:41:20 -0400 Subject: [PATCH] fix: only register reloadSourceOnError once --- src/videojs-http-streaming.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/videojs-http-streaming.js b/src/videojs-http-streaming.js index 15d1eb42b..d5e78284d 100644 --- a/src/videojs-http-streaming.js +++ b/src/videojs-http-streaming.js @@ -1264,10 +1264,10 @@ if (!videojs.use) { videojs.options.vhs = videojs.options.vhs || {}; videojs.options.hls = videojs.options.hls || {}; -if (videojs.registerPlugin) { - videojs.registerPlugin('reloadSourceOnError', reloadSourceOnError); -} else { - videojs.plugin('reloadSourceOnError', reloadSourceOnError); +if (!videojs.getPlugin || !videojs.getPlugin('reloadSourceOnError')) { + const registerPlugin = videojs.registerPlugin || videojs.plugin; + + registerPlugin('reloadSourceOnError', reloadSourceOnError); } export {