DEV: Change video placeholder click target (#23925)

Have the click target be the entire placeholder instead of just the play
button.
This commit is contained in:
Blake Erickson 2023-10-12 21:26:10 -06:00 committed by GitHub
parent 9762e65758
commit b607d81d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ export default {
withPluginApi("0.8.7", (api) => {
function handleVideoPlaceholderClick(helper, event) {
const parentDiv = event.target.closest(".video-placeholder-container");
const wrapper = event.target.closest(".video-placeholder-wrapper");
const wrapper = parentDiv.querySelector(".video-placeholder-wrapper");
const videoHTML = `
<video width="100%" height="100%" preload="metadata" controls style="display:none">
@ -73,8 +73,8 @@ export default {
container.appendChild(wrapper);
overlay.classList.add("video-placeholder-overlay");
overlay.style.cursor = "pointer";
overlay.addEventListener(
container.style.cursor = "pointer";
container.addEventListener(
"click",
handleVideoPlaceholderClick.bind(null, helper),
false