-
Notifications
You must be signed in to change notification settings - Fork 2
/
Embedding youtube video in html without iframe tag
60 lines (47 loc) · 1.27 KB
/
Embedding youtube video in html without iframe tag
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
<!DOCTYPE html>
<html>
<head>
<title>youtube</title>
</head>
<body>
<div id="p1" ></div>
<div id="player2" ></div>
<div id="player3" ></div>
<script type="text/javascript"></script>
<script>
// This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player1,player2,player3;
function onYouTubeIframeAPIReady() {
player1 = new YT.Player('p1', {
height: '400',
width: '400',
videoId: '8jm_56vtUhM',
playerVars: { 'showinfo': 0 , 'autohide':1 , 'color':'white' , 'rel':0},
events: {
//'onReady' : function_name
}
});
player2 = new YT.Player('player2', {
height: '400',
width: '400',
videoId: 'oRYshQCOHOs',
playerVars: { 'showinfo': 0 , 'autohide':1 , 'color':'white' , 'rel':0},
events: {
}
});
player3 = new YT.Player('player3', {
height: '400',
width: '400',
videoId: 'zaqfuMbd06I',
playerVars: { 'showinfo': 0 , 'autohide':1 , 'color':'white' , 'rel':0},
events: {
}
});
}
</script>
</body>
</html>