Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
Getting access of iframe imbedded page elements in js, JavaScript

document.querySelector('#clickbtn').addEventListener('click', () => {
  document.querySelector('.ytp-large-play-button ytp-button').click();
})
<button id="clickbtn">Click</button>


<iframe width="560" height="315" class="clickbtn" src="https://www.youtube.com/embed/cmA-IyD8_BA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in- 
    picture" allowfullscreen>
    </iframe>

I'm trying to start playing video from my own created button. but not working. Have any solution?

console:

Uncaught TypeError: Cannot read properties of null (reading 'click') at HTMLButtonElement.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use the youtube frame api from here, run/stop the video by

function stop() {
  player.stopVideo();
}

OR

function run() {
  player.playVideo();
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!