I'm trying to figure out how to nest embedded YouTube Video and Audio in DIV so I can enter caption beneath them.
See - Test page
I have tried moving captions around, surrounding Audio and Video players with DIVs in different ways so that caption is contained below players, but nothing works.
Audio caption will only display where it is shown located below otherwise it breaks DIV and stretches it to full width with caption to the side.
Audio caption is fine, but I'd like it below the audio player not above.
Video caption never displays no matter what the configuration.
Audio — Uses Amit Agarwal's code from labnol How to Embed YouTube as an Audio Player
Video — Uses W3Schools method and YouTube embed video URL copied from Settings gear icon for video
HTML —
CSS —
See - Test page
I have tried moving captions around, surrounding Audio and Video players with DIVs in different ways so that caption is contained below players, but nothing works.
Audio caption will only display where it is shown located below otherwise it breaks DIV and stretches it to full width with caption to the side.
Audio caption is fine, but I'd like it below the audio player not above.
Video caption never displays no matter what the configuration.
Audio — Uses Amit Agarwal's code from labnol How to Embed YouTube as an Audio Player
Code:
<div class="box right" style="height:150px; width:100px"><html><script src="https://www.youtube.com/iframe_api"></script>
<script src="https://cdn.rawgit.com/labnol/files/master/yt.js"></script>
<div class="right aud margin-l margin-t margin-b" data-video="90WD_ats6eE" data-autoplay="0" data-loop="1" id="youtube-audio"><a href="https://www.youtube.com/watch?v=90WD_ats6eE">The Times They Are A-Changin'</a> - Bob Dylan</div></html></div>
Video — Uses W3Schools method and YouTube embed video URL copied from Settings gear icon for video
Code:
<html><iframe class="left vid margin-r margin-t" width="250" height="140.6" src="https://www.youtube.com/embed/FMTAVDUfEe4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen >Former CIA Operative Robert Baer | JCCSF</iframe></html>
HTML —
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<link rel="stylesheet" href="test.css">
<script src="script.js"></script>
</head>
<body>
<div class="col left1">
<html><script src="https://www.youtube.com/iframe_api"></script>
<script src="https://cdn.rawgit.com/labnol/files/master/yt.js"></script>
<div class="aud right margin-l margin-t margin-b" data-video="90WD_ats6eE" data-autoplay="0" data-loop="1" id="youtube-audio"><a href="https://www.youtube.com/watch?v=90WD_ats6eE">The Times They Are A-Changin'</a> - Bob Dylan</div>
</html>
<html><iframe class="left vid margin-r margin-t" width="250" height="140.6" src="https://www.youtube.com/embed/FMTAVDUfEe4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen >Former CIA Operative Robert Baer | JCCSF</iframe></html>
</div>
</body>
</html>
CSS —
Code:.col { text-align: left; padding: 10px; margin-bottom: 5px; } .left1 { width: 76%; background-color: #f5fafe; margin-right: 5px; border: 1px solid #cedff1; } aud { height: auto; width: 128px; font-size: 0.85em; line-height: 115%; padding: 5px; border: 1px solid #aaa; } .right { float: right; } .aud.margin-t { margin-top: 7px; } .aud.margin-b { margin-bottom: 7px; } .aud.margin-l { margin-left: 10px; } .vid { font-size: 0.85em; line-height: 115%; padding: 5px; border: 1px solid #aaa; } .vid.margin-t { margin-top: 7px; } .vid.margin-r { margin-right: 10px; }