Skip to content

Commit

Permalink
fallback to the default UI if local storage contains invalid UI
Browse files Browse the repository at this point in the history
  • Loading branch information
stonko1994 committed Dec 10, 2024
1 parent c7c53a3 commit 70b519a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ <h4 class="card-title">
const playgroundConfig = getConfigFromStorage();

// Add UI
uiManager = bitmovin.playerui.UIFactory[playgroundConfig.uiOption || 'buildDefaultUI'](player, uiConfig);
if (playgroundConfig.uiOption != null && bitmovin.playerui.UIFactory[playgroundConfig.uiOption] != null) {
uiManager = bitmovin.playerui.UIFactory[playgroundConfig.uiOption](player, uiConfig);
} else {
localStorage.clear();
uiManager = bitmovin.playerui.UIFactory.buildDefaultUI(player, uiConfig);
}

player.load(sources[playgroundConfig.source || 'fullyFeatured']).then(function() {
console.log('source successfully loaded');
Expand Down

0 comments on commit 70b519a

Please sign in to comment.