Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                <div class="container">
	<div class="row">
		<div class="btn-group">
			<button id="play" type="button" class="btn btn-primary disabled">Play</button>
			<button id="pause" type="button" class="btn btn-primary disabled">Pause</button>
			<button id="stop" type="button" class="btn btn-primary disabled">Stop</button>
			<button id="volup" type="button" class="btn btn-primary disabled">Vol Up</button>
			<button id="voldown" type="button" class="btn btn-primary disabled">Vol Down</button>
			<button id="mute" type="button" class="btn btn-primary disabled">Mute</button>
			<button id="speed" type="button" class="btn btn-primary disabled">Speed Up</button>
			<button id="slow" type="button" class="btn btn-primary disabled">Slow Down</button>
		</div>
	</div>
	<div class="row">
		<div id="player-container">
			<div id="player-div"></div>
		</div>
	</div>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                var player;

// This code loads the IFrame Player API code asynchronously. This is the Youtube-recommended script loading method
var tag = document.createElement("script");
tag.src = "https://youtube.com/iframe_api";
tag.id = "youtubeScript";
var firstScriptTag = document.getElementsByTagName("script")[1];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

// Create youtube player (function called by YouTube API)
function onYouTubeIframeAPIReady() {
	player = new YT.Player("player-div", {
		width: "562",
		videoId: "M7lc1UVf-VE",
		playerVars: {
			autoplay: 0,
			controls: 0,
			rel: 0,
			fs: 0,
			showinfo: 0,
			modestbranding: 1
		},
		events: {
			onReady: onPlayerReady,
			onStateChange: onPlayerStateChange
		}
	});
}
// Player ready handler. Autoplay video when player is ready
function onPlayerReady(event) {
	$('.btn').removeClass( "disabled" );
}

$('#play').click(function(){ player.playVideo(); });

$('#pause').click(function(){ player.pauseVideo(); });

$('#stop').click(function(){ player.stopVideo(); });

$('#speed').click(function(){ 
	var rate = player.getPlaybackRate();
	player.setPlaybackRate(rate + 0.25); 
});

$('#slow').click(function(){
	var rate = player.getPlaybackRate();
	if (rate > 0.25)
	{
		player.setPlaybackRate(rate - 0.25); 
	}
});

$('#mute').click(function()
{
	if(player.isMuted())
	{
		player.unMute();
		$('#mute').text('Mute');
	}
	else
	{
		player.mute();
		$('#mute').text('Unmute');
	}
});


$('#volup').click(function(){ 
	var volume = player.getVolume();
	if (volume <= 95)
	{
		player.setVolume(volume + 5); 
	}
});

$('#voldown').click(function(){
	var volume = player.getVolume();
	if (volume > 5)
	{
		player.setVolume(volume - 5); 
	}
});
// Video state change handler.
function onPlayerStateChange(event) {

}

              
            
!
999px

Console