I would like to use a YouTube embed and make it play/pause with JavaScript Control. I have checked the api documentation But all theses cases refer to a iframe that you embed on your website, but I want to use the original YouTube URL and not create a webpage.
Example URL used : https://www.youtube.com/embed/M7lc1UVf-VE?autohide=1&autoplay=1&enablejsapi=1
The problem seems to be that the iframe doesn't have an ID, so I tried many JavaScript command, but the player never pause or play with my Qt Pushbutton.
Any advice appreciated!
QString jsValue = "document.getElementById('ytplayer').pauseVideo();";
ui->webView->page()->mainFrame()->evaluateJavaScript(jsValue);