-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·160 lines (135 loc) · 4.94 KB
/
index.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html PUBLIC "-//HbbTV//1.1.1//EN" "http://www.hbbtv.org/dtd/HbbTV-1.1.1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="Content-Type: application/vnd.hbbtv.xhtml+xml; charset=UTF-8" />
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<title>FSK TEST SUIT</title>
<script src="js/jquery-1.8.1.min.js"> </script>
<script src="js/keycodes.js"></script>
<body onload="init();" style="background: transparent;">
<object id="appmgr" type="application/oipfApplicationManager" style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px;"></object>
<object id="audio" type="audio/mp4" ></object>
<object id="oipfcfg" type="application/oipfConfiguration" style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px;"></object>
<div id="init-banner" style="color:red;position:absolute;top:85%;left:25%;"> <img src="img/banner.png"/></div>
<div style="position:absolute;z-index:999;background:white;opacity:0.6;width:800px;height:600px;color:green;left:300px;top:60px;font-size:28pt;padding:15px;"> FSK TEST SUIT:<span id="log" style="color:red;opacity:1;font-size:16pt;margin-left:10px;"></span></div>
<object id="capobj" type="application/oipfCapabilities" style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px;"></object>
<script>
var start=0;
var end=0;
function init() {
document.onkeydown=eventHandler;
try {
var app = document.getElementById('appmgr').getOwnerApplication(document);
app.show();
setKeyset(0x1+0x2+0x4+0x8+0x10+0x20+0x100);
} catch (e) {$("#log").append(e);}
}
var device=getUrlVars()["device"];
function eventHandler (e){
switch (e.keyCode){
case KEY_GREEN:
if (device=="engel")
createPlayerEngel("shorturl.mp4");
else
createPlayerZas("shorturl.mp3");
break;
case KEY_RED:
if (device=="engel")
createPlayerEngel("longurl.mp4");
else
createPlayerZas("longurl.mp3");
break;
}
return false;
}
var time3=0;
function createPlayerEngel (audio){
try {
var video1=document.getElementById('audio');
video1.type="audio/mp4";
video1.data="http://192.168.10.2/fsk_test/audio/"+audio;
video1.onPlayStateChange = function() {
if (video1.playState==5){
$("#log").append(""+(new Date().getTime()-time3));
video=document.getElementById('audio');
video.stop();
video.type="video/broadcast";
video.bindToCurrentChannel();
video.play(1);
}
if (video1.playState==1){
$("#log").append("<p> "+audio+" playing</p>");
time3=new Date().getTime();
}
if (video1.playState==0){
$("#log").append("<p> broadcast playing </p>");
end=new Date().getTime();
$('#log').append("<p> Processing "+audio+" annoying time:"+(end-start)+"</p>");
}
}
video1.play(1);
start=new Date().getTime();
}
catch (e){
$("#log").append("<p>"+e+"error create player</p>");
}
}
var video2=null;
function createPlayerZas (audio){
try {
if ($('#audio').length) {
$("#log").append("<p>removing</p>");
$('#audio').stop();
video1=document.getElementById("audio");
video1.stop();
document.body.removeChild(document.getElementById('audio'));
}
//video=document.getElementById("video");
// video.stop();
video1=document.createElement("object");
video1.id="audio";
video1.type="audio/mp3";
video1.data="http://192.168.10.2/fsk_test/audio/"+audio;
$('body').append(video1);
video1.onPlayStateChange = function() {
if (video1.playState==5){
video=document.getElementById('audio');
video.stop();
$("#log").append("<p> play sound final</p>");
document.body.removeChild(video);
video2=document.createElement("object");
video2.id="audio";
video2.type="video/broadcast";
$('body').append(video2);
video2.bindToCurrentChannel();
video2.onPlayStateChange = function() {
if (video2.playState==2){
$("#log").append("<p>v:"+video2.playState+"</p>");
$("#log").append("<p> broadcast playing </p>");
end=new Date().getTime();
$('#log').append("<p> Processing "+audio+" annoying time:"+(end-start)+"</p>");
}
}
}
if (video1.playState==1){
$("#log").append("<p> "+audio+" playing2</p>");
}
}
video1.play(1);
start=new Date().getTime();
}
catch (e){
$("#log").append("<p>"+e+"error create player</p>");
}
}
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
</script></head>
</body>
</html>