htmlcssjavascript28
Silver Coder
Code Edit fiddle - JSFiddle - Code Playground
Where should I place this function within the javascript?
Where should I place this function within the javascript?
JavaScript:
const playerManager = (function makePlayerManager() {
function removePlayer() {
videoPlayer.players.forEach(function(player) {
const playerElement = player.getIframe();
if (playerElement) {
const playerClass = playerElement.className;
console.log("Destroying player with class: " + playerClass);
player.destroy();
}
});
console.log("playerRemoved");
}
return {
removePlayer
};
}());
const videoPlayer = (function makeVideoPlayer() {// videoPlayer code here...})();const managePlayer = (function makeManagePlayer() {// managePlayer code here...})();const loadPlayer = (function uiLoadPlayer() {// loadPlayer code here...})();
Last edited: