-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_this.php
89 lines (72 loc) · 2.04 KB
/
run_this.php
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
<html>
<h1>SMART ADS</h1>
<h2>
<form>Enter Video ID
<input type="text" id="textbox1" value="O9oQQmP1RVM">
<button type="submit" id="button1">Go</button>
</form>
</h2>
<body>
<style>
img1 {
position: absolute;";
left: 700px;";
top: 130px;";
z-index: -1;";
}
img2 {
position: absolute;
left: 700px;
top: 300px;
z-index: -1;
}
</style>
<!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
<div id="player"></div>
<script>
//YOUTUBE API
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var player;
var trial=document.getElementById('textbox1');
//var button=document.getElementById('button1');
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: trial.value,
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
event.target.playVideo();
}
// 5. The API calls this function when the player's state changes.
// The function indicates that when playing a video (state=1),
// the player should play for six seconds and then stop.
var done = false;
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.PLAYING && !done) {
setTimeout(stopVideo, 6000);
done = true;
}
}
function stopVideo() {
player.stopVideo();
}
</script>
</body>
<?php
include 'main_php.php';
send2SpeechAPI("");
?>
</html>