Documents

Title
YouTube Embed
Description
Introduction of various embedment methods of YouTube.
Category
Media
Library
YouTube
Include Files
<!-- Use in [8] Thumbnail Click & Play YouTube -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>    
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
Attachment Table

YouTube Iframe Player API

ParametersTypeDefaultDescription
autoplay0 or 10Auto play on / off
cc_load_policy0 or 1User SettingCaption show on / off
colorred or whiteredVideo progress bar's color
controls0 or 11Video player controls show on / off
disablekb0 or 10Keyboard controls on / off
enablejsapi0 or 10JavaScript Player API calls on / off
endpositive integer-Timing setting to stop video play
fs0 or 11Fullscreen button display on / off
hlISO 639-1 two-letter language code or a fully specified localeUser SettingSet interface language
iv_load_policy1 or 31Video annotations show on / off
list'search query' or 'CHANNEL_ID' or 'PLAYLIST_ID'-Specify load content according to listType
listTypesearch or user_uploads or playlist-Set the type of content to load (use with list)
loop0 or 10Loop play on / off
modestbranding0 or 10YouTube logo show on / off
origin0 or 10Extra security measure for the IFrame API on / off (only IFrame API)
playlistcomma-separated list of 'VIDEO_ID'-Multiple 'VIDEO_ID' to play as playlists
playsinline0 or 10Controls whether videos play inline or fullscreen in an HTML5 player on iOS
rel0 or 11Related videos show on / off
showinfo0 or 11Video information show on / off
startpositive integer-Timing setting to start video play
Related

Source Code

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Use in [8] Thumbnail Click & Play YouTube -->
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>    
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <title>YouTube Embed</title>
    <style>
        /* [1] Responsive YouTube Embed */
        .youtube-16-9{
            position: relative;
            height: 0;
            padding-top: 25px;
            padding-bottom: 56.25%;
        }
        .youtube-16-9 iframe{
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
        }
        /* [2] Responsive Vertical YouTube Embed */
        .youtube-9-16{
            position: relative;
            width: 100%;
            height: 0;
            padding-top: 177.528%;
        }
        .youtube-9-16 iframe{
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
        }
        /* [8] Thumbnail Click & Play YouTube */
        .youtube-play{
            position: relative;
            background-size: cover;
        }
        .youtube-play .play{
            font-size: 96px;
            position: absolute;
            top: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            cursor: pointer;
            color: #f00;
        }
        .youtube-play .play:hover{
            color: #fff;
        }
    </style>
</head>
<body>
    <header>
        <h1 class="dlw-title">YouTube Embed</h1>
        <p class="dlw-description">Introduction of various embedment methods of YouTube.</p>
    </header>
    <section>
        <h2 class="dlw-subtitle">[1] Responsive YouTube Embed</h2>
        <div class="youtube-16-9">
            <iframe src="https://www.youtube.com/embed/HCBZ8I2yC1w" allowfullscreen></iframe>
        </div>
    </section>
    <section>        
        <h2 class="dlw-subtitle">[2] Responsive Vertical YouTube Embed</h2>
        <div class="youtube-9-16">
            <iframe src="https://www.youtube.com/embed/8BPTrwu8pn4" allowfullscreen></iframe>
        </div>
    </section>
    <section>
        <h2 class="dlw-subtitle">[3] Endless Playback by YouTube API</h2>
        <div class="youtube-16-9">
            <iframe src="https://www.youtube.com/embed/HCBZ8I2yC1w?autoplay=1&cc_load_policy=0&controls=0&loop=1&modestbranding=1&mute=1&rel=0&showinfo=0" allowfullscreen></iframe>
        </div>
    </section>
    <section>
        <h2 class="dlw-subtitle">[4] YouTube Playlist Embed</h2>
        <div class="youtube-16-9">
            <iframe src="https://www.youtube.com/embed?listType=playlist&list=PLOGi5-fAu8bFBu6hFFeZ1qWJdJUXAOhZG" allowfullscreen></iframe>
        </div>
    </section>
    <section>
        <h2 class="dlw-subtitle">[5] YouTube Search Result Embed</h2>
        <div class="youtube-16-9">
            <iframe src="https://www.youtube.com/embed?listType=search&list=world+news" allowfullscreen></iframe>
        </div>
    </section>
    <section>
        <h2 class="dlw-subtitle">[6] YouTube User Channel Embed</h2>
        <div class="youtube-16-9">
            <iframe src="https://www.youtube.com/embed?listType=user_uploads&list=NationalGeographic" allowfullscreen></iframe>
        </div>
    </section>
    <section>
        <h2 class="dlw-subtitle">[7] YouTube Original Playlist Embed</h2>
        <div class="youtube-16-9">
            <iframe src="https://www.youtube.com/embed?playlist=PQWeWmKB_II,ZdJYKRg99Pw,9bQNRVyI4I0,zqE-ultsWt0" allowfullscreen></iframe>
        </div>
    </section>    
    <section>
        <h2 class="dlw-subtitle">[8] Thumbnail Click & Play YouTube</h2>
        <p>get and display YouTube's thumbnail and click on it to play the video using jQuery.</p>
        <script>
            $(function () {
                $(".youtube-play").each(function () {
                    // Get thumbnails from YouTUbe video ID and set as background image.
                    $(this).css('background-image', 'url(http://i.ytimg.com/vi/' + this.id + '/sddefault.jpg)');
                    // Add play button icon (Font Awesome)
                    $(this).append('<div class="play"><i class="fa fa-youtube-play"></i></div>');
                    // Click on the thumbnail to replace YouTube with autoplay.
                    $(document).delegate('#' + this.id, 'click', function () {
                        var iframe_url = "https://www.youtube.com/embed/" + this.id + "?autoplay=1&autohide=1";
                        $(this).append('<iframe src="' + iframe_url + '" frameorder="0"></iframe>');
                    });
                });
            });
        </script>        
        <div class="youtube-16-9 youtube-play" id="HCBZ8I2yC1w"></div>
    </section>      
</body>
</html>

Comment

Search

Style Design
Text Style DesignCSS

Here, design samples of various effects to text are posted.

Headline (Heading) Style DesignCSS

The headline is the text indicating the nature of the article below it.
Here, design samples of headline using style sheets are posted.

OL (Ordered List) Style DesignCSS

The HTML <ol> element represents an ordered list of items.
Here, design samples of ol using style sheets are posted.

HR (Separator Line) Style DesignCSS

The HTML <hr> element represents a thematic break between paragraph-level elements.
Here, design samples of hr using style sheets are posted.

Box Shadow Style DesignCSS

The box-shadow CSS property is used to add shadow effects around an element's frame.
Here, design samples of box-shadow property using style sheets are posted.

Layout
How to specify a breakpoint and switch imagesJS

Using <picture> and srcset, it is a method of switching images according to screen size. It also corresponds to retina.
In this example, Picturefill is added for IE.

Grid LayoutCSS

Grid is the value of the CSS display property.
Here, layout samples of grid property are posted.

FlexCSS

Flex is the value of the CSS display property.

Link & Button
Bootstrap ButtonCSS

It is a standard button design of Bootstrap Framework.

Hover.cssCSS

Hover.css is a style-sheet collection of hover effects.

Button.cssCSS

Button.css is collection of CSS3 button animations.

Card
Bootstrap CardCSS

It is a standard Card design of Bootstrap Framework.

Text
Arctext.jsjQuery

Arctext.js is a jQuery plugin that causes a string to curve along a specified circle radius.

Lettering.jsjQuery

Lettering.js is a jQuery plugin that encloses a specified character string with one character, one word, one column by <span> tag.

Textillate.jsjQuery

Textillate.js is a jQuery plugin that adds In / Out animation effects to text.

FitText.jsjQuery

FitText.js is jQuery plugin that fits the font size according to the width of the parent element.

Media
FeedEkjQuery

FeedEk is a jQuery plugin that parses RSS and Atom feeds and displays them.

YouTube Embed

Introduction of various embedment methods of YouTube.

FitVids.jsjQuery

FitVids is a jQuery plug-in that converts YouTube videos embedded with iframe into responsive.

xZoomjQuery

xZoom is a jQuery plug-in that shows a zoom preview of the image.
It is possible to customize the preview position and zoom.

Instagram.cssCSS

Instagram.css is a stylesheet set that filters photos like instagram.

Date
Moment.jsJS

Moment.js is a javascript that processes and displays date and time.

Bootstrap Material DatePickerjQuery

Bootstrap Material DatePicker is jQuery data picker plugin using Moment.js.

Table
MultifilterjQuery

Multifilter is jQuery Table Filtering Plugin.

Flex TableCSS

Responsive table using "display: flex;".
Not supported for rowspan.

Grid TableCSS

Responsive table using "display: grid;".
Not supported for rowspan.

Bootstrap TableCSS

It is a standard Table design of Bootstrap Framework.

Form
jQuery Mask PluginjQuery

jQuery Mask Plugin is jQuery plugin that make mask (validation) on form field.

Select2 #1. Basic SettingjQuery

Select2 is a jquery plugin that makes select form more advanced.
Here is the basic usage of Select2.

jQuery SearcherjQuery

jQuery Searcher is jQuery search/filtering plugin that supports various markups.

Slider
Bootstrap CarouseljQuery

It is a standard Carousel of Bootstrap Framework.

FlexSlider #1. Single SliderjQuery

FlexSlider is responsive jQuery slider plugin.
Here, basic single slider setting of Flexslider are posted.

FlexSlider #2. Carousel SliderjQuery

FlexSlider is responsive jQuery slider plugin.
Here, basic carousel slider setting of Flexslider are posted.

slick #1. Single SliderjQuery

slick is responsive jQuery slider plugin.
Here, basic single slider setting of slick are posted.

slick #2. Carousel SliderjQuery

slick is responsive jQuery slider plugin.
Here, carousel slider setting of slick are posted.

Lightbox
fancyBox #1. basic image lightboxjQuery

fancyBox is jQuery lightbox plugin.
Here, basic image lightbox setting of fancyBox are posted.

fancyBox #2. media lightboxjQuery

fancyBox is jQuery lightbox plugin.
Here, YouTube, Vimeo, Instagram, Google Maps, inline HTML, iframe lightbox setting of fancyBox are posted.

Magnific Popup #1. basic image lightboxjQuery

Magnific Popup is jQuery lightbox plugin.
Here, basic image lightbox setting of Magnific Popup are posted.

Magnific Popup #2. media lightboxjQuery

Magnific Popup is jQuery lightbox plugin.
Here, YouTube, Vimeo, Google Maps, inline HTML lightbox setting of Magnific Popup are posted.

Magnific Popup #3. CSS3-based animation effectsjQuery

Since Magnific Popup does not incorporate animation effects by standard, you need to set it yourself.
Here we summarize the CSS3-based animation settings.

Navigation
animsitionjQuery

animsition is a jQuery plugin that adds an in/out animation effect at the time of page transition.

GreedyNavjQuery

GreedyNav is a responsive navigation menu using jQuery which switches over the items that protruded when the screen was scaled down to dropdown.

GridTabjQuery

GridTab is a lightweight jQuery plugin to create grid based responsive tabs.

jQuery.NiceScrolljQuery

jQuery.NiceScroll is a jQuery plugin that extends scroll display and functions.

metisMenujQuery

metisMenu is a jQuery plugin that expands vertical and vertical menus.

fullPage.js #1. basic fullscreen scrollingjQuery

fullPage.js is jQuery Fullscreen Scrolling plugin.
Here, basic fullscreen scrolling of fullPage.js are posted.

fullPage.js #2. fullscreen scrolling with menujQuery

fullPage.js is jQuery Fullscreen Scrolling plugin.
Here, navigation menu is displayed..

Offside.js #1. Basic Off-canvasJS

Offside.js is a JavaScript kit that expands off-canvas.
This is a sample where the left side off-canvas expands.

Offside.js #2. Multiple Off-canvasJS

Offside.js is a JavaScript kit that expands off-canvas.
This is a sample that expands multiple off-canvases.

Filterizr #1. Basic FilteringjQuery

Filterizr is a jQuery plugin that sorts, shuffles, searches for the items in the container.
This is a basic sample without setting options.

Filterizr #2. Advanced FilteringjQuery

Filterizr is a jQuery plugin that sorts, shuffles, searches for the items in the container.
This is a sample of more advanced setting of Filterizr.

Animation
animsitionjQuery

animsition is a jQuery plugin that adds an in/out animation effect at the time of page transition.

Textillate.jsjQuery

Textillate.js is a jQuery plugin that adds In / Out animation effects to text.

ScrollajQuery

Scrolla is jQuery scroll animation plugin.

Hover.cssCSS

Hover.css is a style-sheet collection of hover effects.

Animate.cssCSS

Animate.css is a style-sheet collection of animation effects.

jQuery Easing PluginjQuery

jQuery Easing Plugin is a plugin to extend the easing (animation effect) of jQuery.
The easing of element is posted.

Background
fullPage.js #1. basic fullscreen scrollingjQuery

fullPage.js is jQuery Fullscreen Scrolling plugin.
Here, basic fullscreen scrolling of fullPage.js are posted.

fullPage.js #2. fullscreen scrolling with menujQuery

fullPage.js is jQuery Fullscreen Scrolling plugin.
Here, navigation menu is displayed..

jquery.mb.YTPlayerjQuery

jQuery.mb.YTPlayer is jQuery Background player plugin.

Modal / Tooltip
Hint.cssCSS

Hint.css is a style sheet set for tooltip.
You can display tooltip just by adding class name.

ProtipjQuery

Protip is a jQuery plugin that generates tooltips.
Set the position, size, etc. of the tooltip only with data attribute.

Social
Framework
Bootstrap CarouseljQuery

It is a standard Carousel of Bootstrap Framework.

Bootstrap CardCSS

It is a standard Card design of Bootstrap Framework.

Bootstrap ButtonCSS

It is a standard button design of Bootstrap Framework.

Bootstrap TableCSS

It is a standard Table design of Bootstrap Framework.

Cheat Sheet
HTML5 Cheat Sheet

HTML5 Cheat Sheet by Make A Website Hub

CSS3 Cheat Sheet

CSS3 Cheat Sheet by Smashing Magazine

Visual Studio Code Keyboard Shortcuts

This is the Visual Studio Code default keyboard shortcut list.

GreenSock Cheat Sheet

Cheese sheet of TweenMAX, TweenLite, TimelineLite, TimelineMax by GreenSock.

Other
Google Search

On this page you can search for codes collectively.

Design News

It is a news feed about design.