Z
Z
z_u_q2018-04-17 19:29:45
YouTube
z_u_q, 2018-04-17 19:29:45

Why doesn't the video play when I click the play button?

When trying to customize a video from YouTube (changing the play button + text), it was displayed in the console.
Uncaught ReferenceError: playVideo is not defined
https://codepen.io/malinosky/pen/aGoKEa

document.getElementById("ArrowBtn").addEventListener("click", playVideo);

function arrowVideo() {
    document.getElementById("ytplayer").classList.add('block');
}

I wanted to register that when you click on my triangle, the video starts playing. The Youtube API has a playVideo function. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jumandjilos, 2018-04-17
@Jumandjilos

the fact is that the playVideo function does not exist

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question