forked from pupunzi/jquery.mb.YTPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
137 lines (125 loc) · 5.64 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<!--
~ jquery.mb.components
~
~ file: demo.html
~ last modified: 23/06/14 22.32
~
~ Open lab srl, Firenze - Italy
~
~ email:
~ site:
~ http://pupunzi.com
~ http://open-lab.com
~ blog:
~ http://pupunzi.open-lab.com
~ Q&A:
~ http://jquery.pupunzi.com
~
~ Licences: MIT, GPL
~ http://www.opensource.org/licenses/mit-license.php
~ http://www.gnu.org/licenses/gpl.html
~
~ Copyright (c) 2001-2014. Matteo Bicocchi (Pupunzi);
-->
<html>
<head>
<meta charset="UTF-8">
<title>youtube Chromeless Player - mb.YTPlayer</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script type="text/javascript" src="inc/jquery.mb.YTPlayer.js"></script>
<link href="css/YTPlayer.css" media="all" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Lekton' rel='stylesheet' type='text/css'>
<style>
body{
border:none;
margin:0;
padding:30px;
background: #e4a51b;
font:normal 16px/20px Lekton, sans-serif;
}
.player{
display:inline-block;
vertical-align:top;
position:relative;
width:500px;
height:350px;
margin-top:100px;
left:0;
overflow: hidden;
border-radius: 4px;
-moz-box-shadow: 0 0 10px rgba(0,0,0,.5);
box-shadow: 0 0 10px rgba(0,0,0,.5);
}
</style>
<script>
jQuery(function(){
if (self.location.href == top.location.href){
var logo=$("<a href='http://pupunzi.com/#mb.components/components.html' style='position:absolute;top:0;z-index:1000'><img id='logo' border='0' src='http://pupunzi.com/images/logo.png' alt='mb.ideas.repository'></a>");
$("#wrapper").prepend(logo);
$("#logo").fadeIn();
}
//debug functions
jQuery("#bgndVideo").on("YTPStart", function(){
jQuery("#eventListener").html("YTPStart");
jQuery("#eventListener").append(" :: (state= "+ jQuery("#bgndVideo").getPlayer().getPlayerState()+")");
jQuery("#eventListener").append(" :: (quality= "+ jQuery("#bgndVideo").getPlayer().getPlaybackQuality()+")");
});
jQuery("#bgndVideo").on("YTPLoop", function(e){
jQuery("#eventListener").html("YTPLoop");
jQuery("#eventListener").append(" :: (state= "+ jQuery("#bgndVideo").getPlayer().getPlayerState()+")");
jQuery("#eventListener").append(" :: "+ e.counter);
});
jQuery("#bgndVideo").on("YTPEnd", function(){
jQuery("#eventListener").html("YTPEnd");
jQuery("#eventListener").append(" :: (state= "+ jQuery("#bgndVideo").getPlayer().getPlayerState()+")");
console.debug("YTPEnd")
});
jQuery("#bgndVideo").on("YTPPause", function(){
jQuery("#eventListener").html("YTPPause");
jQuery("#eventListener").append(" :: (state= "+ jQuery("#bgndVideo").getPlayer().getPlayerState()+")");
});
jQuery("#bgndVideo").on("YTPBuffering", function(){
jQuery("#eventListener").html("YTPBuffering");
jQuery("#eventListener").append(" :: (state= "+ jQuery("#bgndVideo").getPlayer().getPlayerState()+")");
});
jQuery(".player").mb_YTPlayer({
onReady: function(){
jQuery("#eventListener").append(" (Player is ready)");
}
});
});
var v = false;
function changeVideo(){
var vID = v ? "7SnmCUwOsts" : "BsekcY04xvQ";
jQuery('#bgndVideo').changeMovie({videoURL:vID});
$("#vidData").toggle(1000);
v = !v;
}
</script>
</head>
<body>
<div id="wrapper" style="position:relative; padding:30px 20px;z-index:10">
<h1 style="color:white"> jQuery.mb.YTPlayer </h1>
<h2 style="color:white"> A Background HTML5 player for YouTube videos</h2>
<div class="console">
<button class="command" onclick="jQuery('#bgndVideo').playYTP()"> play </button>
<button class="command" onclick="jQuery('#bgndVideo').pauseYTP()"> pause </button>
<button class="command" onclick="changeVideo();"> switch video </button>
<button class="command" onclick="alert(jQuery('#bgndVideo').getPlayer().getPlaybackQuality())"> quality </button>
<button class="command" onclick="alert(jQuery('#bgndVideo').get(0).player.getVolume())"> volume </button>
<br>
<br>
<span style="font-size: 18px;">events: </span><span id="eventListener" style="font-size: 18px;">(trace player events)</span>
<h3 id="vidData" style="color:white">
AIMLESS
<br> music by Pietro Bicocchi
<br> video by Matteo Bicocchi
</h3>
</div>
</div>
<a id="bgndVideo" class="player" data-property="{videoURL:'7SnmCUwOsts',containment:'body', showControls:true, autoPlay:true, loop:false, vol:50, mute:true, startAt:10, opacity:1, addRaster:false, quality:'default'}">My video</a> <!--BsekcY04xvQ-->
<a style="position: fixed;top:20px;right: 20px;" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=V6ZS8JPMZC446&lc=GB&item_name=mb%2eideas&item_number=MBIDEAS&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG_global%2egif%3aNonHosted"><img border="0" alt="PayPal" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif" class="alignright"></a>
</body>
</html>