Home/Exit button is the same button.
https://jsfiddle.net/awy26kon/
Currently after it is clicked, it disappears from the screen, And it appears on the screen when it is supposed to show.
That means, show/hide are both working.
After that you can set it up to listen for home events and exit events.
Would this be the stuff that stops the video after the home/exit button is clicked?
player.stopVideo();
I need help with that part.
Are there instructions I can follow to set that up?
When it comes to this:
https://jsfiddle.net/p5ova3tj/
I think āStopā would be a better name than āCloseā as that is what it is doing in the code, after the home/exit button is clicked, the video should stop.
or maybe, it should be Close instead?
What do you think?
function addStopHandler(stopSelector, handler) {
const stop = document.querySelector(stopSelector);
stop.addEventListener("click", handler);
}
return {
addStopHandler,
init
};
}());
Also: Will I be adding something similar to this?
function addPlayer(stopSelector, playerSettings) {
const clickHandler = createCoverClickHandler(playerSettings);
manageUI.addStopHandler(addStopHandler, clickHandler);
}
Which would be placed under this function:
function addPlayer(coverSelector, playerSettings) {
const clickHandler = createCoverClickHandler(playerSettings);
manageCover.addCoverHandler(coverSelector, clickHandler);
}
function addPlayer(stopSelector, playerSettings) {
const clickHandler = createCoverClickHandler(playerSettings);
manageUI.addStopHandler(addStopHandler, clickHandler);
}
or, am I just adding on to this function?
function addPlayer(coverSelector, playerSettings) {
const clickHandler = createCoverClickHandler(playerSettings);
manageCover.addCoverHandler(coverSelector, clickHandler);
}
This is what you said:
It seems that there is a rather obvious solution to this, that being to add to the manageCover code a method called addCloseHandler similar to the addCoverHandler, so that you can later on use manageCover.addCloseHandler to give it a function that stops the player.
So, then I would be adding inside this code the ability for the video to stop after the home button is clicked?
function addPlayer(coverSelector, playerSettings) {
const clickHandler = createCoverClickHandler(playerSettings);
manageCover.addCoverHandler(coverSelector, clickHandler);
}
I need direction on how to implement what I am trying to do in the code.
Which is, having the video stop, after the home button is clicked.
After the home button is clicked, this should occur: player.stopVideo();