Revision 106926 of "Template:YouTubeWithCommonsFallback" on foundationwiki

<html>
<style>
.video-outer-wrapper {
    max-width: </html>{{{width|640}}}<html>px;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 30px;
    height: 0;
    overflow: hidden;
}
.video-wrapper .video-placeholder {
    cursor: pointer;
}
.video-wrapper .video-placeholder,
.video-wrapper .video-commons,
.video-wrapper iframe,
.video-wrapper object,
.video-wrapper embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.video-caption {
    font-size: small;
}
.play-btn-large {
    z-index: auto;
}
</style>
<div class="video-outer-wrapper">
    <div class="video-wrapper">
        <img class="video-placeholder" src="</html>{{filepath:{{{placeholder|Wikipedia_Puzzle_Globe.jpg}}}|{{{width|640}}}}}<html>" class="thumbimage">
        <div class="video-commons" style="display:none;">
            </html>[[{{{commons|File:The_Impact_Of_Wikipedia.webm}}}|{{{width|640}}}px]]<html>
        </div>
    </div><!-- /video-wrapper -->
    <div class="video-caption" style="text-align:center;">
        <p>This video hosted by YouTube.com is subject to its <a class="external text" href="//www.youtube.com/t/terms">Terms of Use</a> and <a class="external text" href="//www.google.com/intl/en/policies/privacy/">Privacy Policy</a>. If you prefer, view on Wikimedia commons: <a id="showcommonsvideo" href=</html>{{fullurl:commons:{{{commons|File:The_Impact_Of_Wikipedia.webm}}}}}<html></a>.</p>
    </div>
</div><!-- /video-outer-wrapper -->
<script>
$(".video-placeholder").click(function () {
    $(this).replaceWith(
        $("<iframe></iframe>", {
            class : "video-youtube",
            frameborder : 0,
            allowfullscreen : 1,
            cc_load_policy : 1,
            show_info : 0,
            enablejsapi : 1,
            src : "https://www.youtube-nocookie.com/embed/" + "</html>{{{youtube|3Knv6D6Thi0}}}<html>" + "?rel=0&autoplay=1&origin=wikimediafoundation.org&theme=light&modestbranding=1&color=white"
        })
    );
});

$("a#showcommonsvideo").click(function(event){
    event.preventDefault();
    showCommonsVideo();
});

if( mw.util.getParamValue( "commons" ) == "true" ){
    showCommonsVideo();
}

function showCommonsVideo() {
    $('.video-youtube').remove();
    $('.video-placeholder').css('display', 'none');
    $('.video-commons').css('display', 'block');
}
</script>
</html><noinclude><pre>{{YouTubeWithCommonsFallback
| placeholder = Wikipedia_Puzzle_Globe.jpg
| youtube     = 3Knv6D6Thi0
| commons     = File:The_Impact_Of_Wikipedia.webm
| width       = 640
}}</pre></noinclude>