Skip to content

Commit

Permalink
fix: only register reloadSourceOnError once
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Aug 31, 2021
1 parent 269f66e commit 19985ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/videojs-http-streaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 19985ff

Please sign in to comment.