Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="movieWrap">
  <div id="player"></div>
<div class="buttons">
  <button id="stopMovie" type="button" class="button -stop">STOP</button>
  <button id="pauseMovie" type="button" class="button -pause">PAUSE</button>
  <button id="playMovie" type="button" class="button -play">PLAY</button>

iframe 組み込みの YouTube Player API リファレンス:<a href="" target="_blank"></a><br>

YouTube 埋め込みプレーヤーとプレーヤーのパラメータ:
<a href="" target="_blank"></a>



                .movieWrap {
  position: relative;
  padding-top: 56.25%;
  iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

.buttons {
  position: absolute;
  top: 30px;
  right: 30px;

.button {
  display: flex;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #fff;
  &.-stop {
    background-color: red;
  &.-pause {
    background-color: yellow;
    color: black;
  &.-play {
    background-color: green;



                // IFrame Player API の読み込みタグを挿入
const tag = document.createElement('script')
tag.src = ""
const firstScriptTag = document.getElementsByTagName('script')[0]
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag)

// 関数onYouTubeIframeAPIReadyでiframeとYoutubeプレイヤーを作成
let player
function onYouTubeIframeAPIReady() {
  player = new YT.Player('player', {
    videoId: 'M7lc1UVf-VE',
    playerVars: {
      // 'autoplay': 1,
      // 'mute': 1,
      // 'controls': 0,
      'loop': 1,
      'playlist': 'M7lc1UVf-VE',
      //'rel': 0

// 動画の操作
const stopButton = document.getElementById('stopMovie')
const pauseButton = document.getElementById('pauseMovie')
const playButton = document.getElementById('playMovie')

stopButton.addEventListener('click', ()=> {

pauseButton.addEventListener('click', ()=> {

playButton.addEventListener('click', ()=> {