There are no notes for this item.

  • Handle: @youtube-playlist
  • Preview:
  • Filesystem Path: src/components/02-blocks/media/youtube-playlist/youtube-playlist.hbs
<div class="ContentBlock YouTubePlayer Page10">
    <script>
        missouristate.addLoadEvent(function() {
            function getHeight(elem) {
                return Math.round(elem.clientWidth * 9 / 16);
            }
            var elems = document.getElementsByClassName('Page10');
            for (var i = 0; i < elems.length; i++) {
                var iframes = elems[i].getElementsByTagName('iframe');
                if (iframes.length > 0) {
                    continue;
                }
                var iframe = document.createElement('iframe');
                iframe.width = '100%';
                iframe.height = getHeight(elems[i]);
                missouristate.addEvent(window, 'resize', (function(iframe) {
                    return function() {
                        iframe.height = getHeight(iframe);
                    };
                })(iframe));
                iframe.setAttribute('allowfullscreen', 'allowfullscreen');
                if (!document.addEventListener) {
                    iframe.setAttribute('frameborder', 'no');
                }
                if (document.attachEvent) {
                    iframe.setAttribute('scrolling', 'no');
                }
                var src = 'PLdLiRaajwSXQ8lElZCiOt95OrjVVFGE2m';
                if (src.indexOf('http') === 0) {
                    src = src.substring(src.indexOf('/'));
                } else {
                    src = 'https://www.youtube.com/embed/?listType=playlist&list=' + src;
                }
                iframe.title = 'YouTube Video';
                iframe.src = src;
                elems[i].appendChild(iframe);
            }
        });
    </script>
</div>
<div class="ContentBlock YouTubePlayer Page{{pageId}}">
    <script>
        missouristate.addLoadEvent(function () {
            function getHeight(elem) {
                return Math.round(elem.clientWidth * 9 / 16);
            }
            var elems = document.getElementsByClassName('Page{{pageId}}');
            for (var i = 0; i < elems.length; i++) {
                var iframes = elems[i].getElementsByTagName('iframe');
                if (iframes.length > 0) { continue; }
                var iframe = document.createElement('iframe');
                iframe.width = '100%';
                iframe.height = getHeight(elems[i]);
                missouristate.addEvent(window, 'resize', (function (iframe) {
                    return function () { iframe.height = getHeight(iframe); };
                })(iframe));
                iframe.setAttribute('allowfullscreen', 'allowfullscreen');
                if (!document.addEventListener) { iframe.setAttribute('frameborder', 'no'); }
                if (document.attachEvent) { iframe.setAttribute('scrolling', 'no'); }
                var src = '{{youTubePlaylistId}}';
                if (src.indexOf('http') === 0) {
                    src = src.substring(src.indexOf('/'));
                } else {
                    src = 'https://www.youtube.com/embed/?listType=playlist&list=' + src;
                }
                iframe.title = 'YouTube Video';
                iframe.src = src;
                elems[i].appendChild(iframe);
            }
        });
    </script>
</div>
{
  "pageId": 10,
  "youTubePlaylistId": "PLdLiRaajwSXQ8lElZCiOt95OrjVVFGE2m"
}