UNPKG

jquery.mb.ytplayer

Version:

This plugin let you play any public YouTube video as background of your page. It can also be used as a customized player in page.

258 lines (211 loc) 6.64 kB
<!--:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: jquery.mb.components file: demo-abundance-anchor.html last modified: 10/25/18 8:00 PM Version: {{ version }} Build: {{ buildnum }} Open Lab s.r.l., Florence - Italy email: matteo@open-lab.com blog: http://pupunzi.open-lab.com site: http://pupunzi.com http://open-lab.com Licences: MIT, GPL http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html Copyright (c) 2001-2018. Matteo Bicocchi (Pupunzi) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::--> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <title>Youtube Chromeless Player - mb.YTPlayer</title> <link href='//fonts.googleapis.com/css?family=Lekton|Lobster' rel='stylesheet' type='text/css'> <link href="../dist/css/jquery.mb.YTPlayer.min.css" media="all" rel="stylesheet" type="text/css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="../dist/jquery.mb.YTPlayer.js"></script> <script src="assets/apikey.js"></script> <style> *:focus { outline: none; } body { border: none; margin: 0; padding: 30px; background: #003e50; font: normal 16px/20px Lekton, sans-serif; } a { color: white; text-decoration: none; } h1 { text-align: center; font-size: 50px; font-family: 'Lobster', cursive; } h2 { font-family: "Open Sans", sans-serif; font-size: 35px; text-align: left; line-height: 60px; } h1, h2 { font-family: 'Lobster', cursive; text-shadow: 10px 10px 20px rgba(0, 0, 0, 0.30); color: #000000; font-weight: 200; } #wrapper { position: relative; min-width: 700px; } .console { margin-top: 20px; text-align: left; } button, .button { transition: all .4s; display: inline-block; padding: 0px 10px; font-size: 14px; /*text-transform: uppercase;*/ cursor: pointer; background-color: rgba(0, 0, 0, 0.40); box-shadow: 0 0 4px rgba(0, 0, 0, 0.4); color: #fff; border: 1px solid transparent; text-decoration: none; line-height: 30px; margin: 3px; border-radius: 10px; } button:hover, .button:hover { background-color: rgb(0, 0, 0); color: #FFF; border: 1px solid #fff; } #info { position: absolute; top: 0; right: 0; max-width: 300px; color: #212121; background-color: rgba(255, 255, 255, 0.60); font-size: 150%; padding: 10px; display: none; } #wp { position: fixed; z-index: 10; min-width: 300px; background: rgba(0, 0, 0, 0.55); /*background: #ffb200;*/ color: #fff; font-size: 24px; line-height: 24px; padding: 20px; bottom: 30px; right: 230px; cursor: pointer; text-align: left; border-radius: 10px; font-family: 'Lobster', cursive; } #wp:hover { background: #000000; } #wp img { width: 60px; margin-right: 20px; } @media only screen and (max-device-width: 480px) { h1 { margin-top: 80px; text-align: left; font-size: 40px; font-family: 'Lobster', cursive; } h2 { font-size: 25px; text-align: left !important; line-height: 1.2; } #wrapper { position: relative; min-width: 100%; } #info { position: fixed; top: 0; right: 0; max-width: 300px; color: #212121; background-color: rgba(255, 255, 255, 1); z-index: 10000; font-size: 100%; padding: 10px; display: none; } #donate { display: none; } #wp { position: relative; top: auto; left: auto; } } </style> <script> var myPlayer; function showInfo(info) { $("#info").stop().delay(500).html(info).stop().fadeIn().delay(5000).fadeOut(); } jQuery(function () { myPlayer = jQuery("#bgndVideo").YTPlayer(); myPlayer.on("YTPData", function (e) { showInfo(e.prop.title + "<br><br>@" + e.prop.channelTitle); }); }); </script> </head> <body> <div id="wrapper" style="position:relative; padding:10px 0;z-index:10"> <a href='https://pupunzi.com/#mb.components/components.html' style='position:absolute;top:0;z-index:1000'><img id='logo' border='0' src='https://pupunzi.com/images/logo.png' alt='mb.ideas.repository'></a> <h1 style="color:white">jQuery.mb.YTPlayer</h1> <h2 style="color:white"> An HTML5 Background player <br>for YouTube videos</h2> <h2 style="color:white">Discover the Abundance and the Anchor parameters</h2> <div class="console"> <button onclick="myPlayer.YTPTogglePlay()">YTPTogglePlay</button> <button onclick="myPlayer.YTPToggleVolume()">YTPToggleVolume</button> <br> <button>YTPSetAbundance() <input type="range" id="abundanceVal" min="0" max="100" value="0" oninput="myPlayer.YTPSetAbundance(jQuery('#abundanceVal').val()/100, true); jQuery('#abundanceValNumber').html(jQuery('#abundanceVal').val()/100)" /> <span id="abundanceValNumber"></span> </button> <button onclick="showInfo(myPlayer.YTPGetAbundance())">YTPGetAbundance</button> <br> <button >YTPSetAnchor() <select onchange="myPlayer.YTPSetAnchor(jQuery('#anchorVal').val())" id="anchorVal"> <option value="center,center" selected>center,center</option> <option value="top,center" >top,center</option> <option value="bottom,center" >bottom,center</option> <option value="bottom,right" >bottom,right</option> <option value="top,right" >top,right</option> <option value="bottom,left" >bottom,left</option> <option value="top,left" >top,left</option> </select></button> <button onclick="showInfo(myPlayer.YTPGetAnchor())">YTPGetAnchor</button> </div> <div id="info"></div> <!--r1xohS2u69E--> <!--7SnmCUwOsts--> <!--IJNR2EpS0jw--> <a id="bgndVideo" class="player" data-property="{videoURL:'IJNR2EpS0jw',containment:'body', showControls:true, autoPlay:false, loop:true, vol:50, mute:false, startAt:40, stopAt:150, opacity:1, addRaster:true, quality:'hd720', abundance:0}">My video</a> <!--BsekcY04xvQ--> </div> </body> </html>