YouTube iframe code not working
Solved
mobrobot
Posted messages
182
Status
Membre
-
Pitet Posted messages 2845 Status Membre -
Pitet Posted messages 2845 Status Membre -
Good evening, with the YouTube iframe code I tried to embed a video from my channel, the result shows nothing at all, I went through the YouTube developer page when I embed the proposed code, it seems to give nothing, if you have a solution. Thank you.
2 réponses
Hello,
The code provided by the documentation works correctly but does not include the iframe tag within the div tag id="player", it uses JavaScript to create the iframe tag.
Example: https://jsfiddle.net/vcf7926g/
Doc: https://developers.google.com/youtube/iframe_api_reference?hl=en
Another solution is to directly embed the iframe tag in HTML.
Example: https://jsfiddle.net/12Lfy6vm/
More info: https://support.google.com/youtube/answer/171780?hl=en
If nothing appears on the page, check the JavaScript console in the browser for errors.
The code provided by the documentation works correctly but does not include the iframe tag within the div tag id="player", it uses JavaScript to create the iframe tag.
Example: https://jsfiddle.net/vcf7926g/
Doc: https://developers.google.com/youtube/iframe_api_reference?hl=en
Another solution is to directly embed the iframe tag in HTML.
Example: https://jsfiddle.net/12Lfy6vm/
More info: https://support.google.com/youtube/answer/171780?hl=en
If nothing appears on the page, check the JavaScript console in the browser for errors.