forked from jnightlee/xiaojiejie-1
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
543 lines (514 loc) · 23.3 KB
/
Copy pathindex.html
File metadata and controls
543 lines (514 loc) · 23.3 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ZG4SMQ6WCB"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-ZG4SMQ6WCB');
</script>
<meta charset="UTF-8">
<meta name="google" value="notranslate">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name=author content="XJJ">
<meta name=description content="XJJ | Dancing Girls">
<meta name=keywords content="xiaojiejie, xjj">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rev="made" href="https://github.com/51sec/xjj">
<title>Videos-|-XJJ</title>
<script type="text/javascript">
if(!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { window.location.href = "pc.html"; }//不是移动设备,跳转
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?86194243b3d0dc98474adb8d6755d003";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script async custom-element="amp-auto-ads" src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js"></script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5660349373091698" crossorigin="anonymous"></script>
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<style type="text/css">
@charset "utf-8";
@font-face{font-family:electronicFont;src:url(./css/DS-DIGIT.TTF)}
*{
margin: 0px;
padding: 0px;
touch-action: auto;/*触控事件*/
text-align: center;
}
.app{
width: 100vw;
height: 100vh;
position: absolute; /*定位类型:绝对定位*/
margin: 0;
overflow: hidden;/*内容溢出:被修剪,且其余内容不可见*/
background-color: #ffffff;
}
#player{
width: 100%;
height: 100%;
object-fit: cover; /*内容保持原比例,内容被裁剪*/
object-position: center center;/*指定 image 或 video 在容器中的位置*/
z-index: 333;/*显示在最顶层*/
}
video::-internal-media-controls-download-button {
display:none;
}
video::-webkit-media-controls-enclosure {
overflow:hidden;
}
video::-webkit-media-controls-panel {
width: calc(100% + 30px);
}
</style>
<!--Anti-ads-block code-->
<style>
#haaa {
position: fixed; /* Fixed position to cover the whole screen */
top: 3px;
left: 2px;
width: 100vw;
height: 90vh;
background-color: #fff;
opacity: 0.95;
display: block;
padding: 20% 0;
}
#haaa * {
text-align: center;
margin: 0 auto;
display: block;
font: bold 18px Verdana, Arial, sans-serif;
text-decoration: none;
color: yellow;
}
</style>
<div id="haaa"><font>Please enable / Bitte aktiviere JavaScript!<br>Veuillez activer / Por favor activa el Javascript!<a href="http://sites.51sec.org">[ ? ]</a></font></div><script>window.document.getElementById("haaa").parentNode.removeChild(window.document.getElementById("haaa"));(function(l,m){function n(a){a&&haaa.nextFunction()}var h=l.document,p=["i","s","u"];n.prototype={rand:function(a){return Math.floor(Math.random()*a)},getElementBy:function(a,b){return a?h.getElementById(a):h.getElementsByTagName(b)},getStyle:function(a){var b=h.defaultView;return b&&b.getComputedStyle?b.getComputedStyle(a,null):a.currentStyle},deferExecution:function(a){setTimeout(a,2E3)},insert:function(a,b){var c=h.createElement("font"),e=h.body,d=e.childNodes.length,g=e.style,f=0,k=0;if("haaa"==b){c.setAttribute("id",b);g.margin=g.padding=0;g.height="100%";for(d=this.rand(d);f<d;f++)1==e.childNodes[f].nodeType&&(k=Math.max(k,parseFloat(this.getStyle(e.childNodes[f]).zIndex)||0));k&&(c.style.zIndex=k+1);d++}c.innerHTML=a;e.insertBefore(c,e.childNodes[d-1])},r:function(a){var b=h.body.style;this.getElementBy(a).parentNode.removeChild(this.getElementBy(a));b.height=b.margin=b.padding=""},displayMessage:function(a){a="abisuq".charAt(this.rand(5));var b,c='<input type="button" onclick="haaa.r(\'haaa\')" value=20 disabled></'+a+">";this.insert("<"+a+'>Please disable your ad blocker!<br> <br>Visit blog.51sec.org, www.51sec.org for more! <br><br>Bitte deaktiviere Deinen Werbeblocker!<br>Veuillez désactiver votre bloqueur de publicité!<br>Por favor, desactive el bloqueador de anuncios! <a href="http://sites.51sec.org">[ ? ]</a>'+c,"haaa");c=this.getElementBy("haaa").firstChild.lastChild;b=setInterval(function(){c.value--;1>c.value&&(clearInterval(b),c.value="Close",c.disabled="")},1E3)},i:function(){for(var a="adSky,adunitl,div-ad-1x1,marquee_ad,right_ad_2,slider_ad,visual-ad,ad,ads,adsense".split(","),b=a.length,c="",e=this,d=0,g="abisuq".charAt(e.rand(5));d<b;d++)e.getElementBy(a[d])||(c+="<"+g+' id="'+a[d]+'"></'+g+">");e.insert(c);e.deferExecution(function(){for(d=0;d<b;d++)if(null==e.getElementBy(a[d]).offsetParent||"none"==e.getStyle(e.getElementBy(a[d])).display)return e.displayMessage("#"+a[d]+"("+d+")");e.nextFunction()})},s:function(){var a={'pagead2.googlesyndic':'google_ad_client','js.adscale.de/getads':'adscale_slot_id','get.mirando.de/miran':'adPlaceId'},b=this,c=b.getElementBy(0,"script"),e=c.length-1,d,g,f,k;h.write=null;for(h.writeln=null;0<=e;--e)if(d=c[e].src.substr(7,20),a[d]!==m){f=h.createElement("script");f.type="text/javascript";f.src=c[e].src;g=a[d];l[g]=m;f.onload=f.onreadystatechange=function(){k=this;l[g]!==m||k.readyState&&"loaded"!==k.readyState&&"complete"!==k.readyState||(l[g]=f.onload=f.onreadystatechange=null,c[0].parentNode.removeChild(f))};c[0].parentNode.insertBefore(f,c[0]);b.deferExecution(function(){if(l[g]===m)return b.displayMessage(f.src);b.nextFunction()});return}b.nextFunction()},u:function(){var a=".480x60-,.480x60/,/120_600_,/468-60.,/468x72_,/486x60_,/780x90.,_300x250-,_468-60_,_728x60.".split(","),b=this,c=b.getElementBy(0,"img"),e,d;c[0]!==m&&c[0].src!==m&&(e=new Image,e.onload=function(){d=this;d.onload=null;d.onerror=function(){p=null;b.displayMessage(d.src)};d.src=c[0].src+"#"+a.join("")},e.src=c[0].src);b.deferExecution(function(){b.nextFunction()})},nextFunction:function(){var a=p[0];a!==m&&(p.shift(),this[a]())}};l.haaa=haaa=new n;h.addEventListener?l.addEventListener("load",n,!1):l.attachEvent("onload",n)})(window);</script>
</head>
<body>
<amp-auto-ads type="adsense"
data-ad-client="ca-pub-5660349373091698">
</amp-auto-ads>
<amp-ad width="100vw" height="320"
type="adsense"
data-ad-client="ca-pub-5660349373091698"
data-ad-slot="7912531145"
data-auto-format="rspv"
data-full-width="">
<div overflow=""></div>
</amp-ad>
<div class="app" ontouchmove="return false;">
<video id="player" src="demo.mp4" autoplay preload mutedNew webkit-playsinline='true' playsinline='true' x5-video-player-type='h5' x5-video-player-fullscreen='true' x5-video-ignore-metadata='true' poster="./img/bg.gif"></video>
<!--[autoplay:自动播放] [mutedNew:初始化静音][mutedNew:初始化静音][webkit-playsinline|playsinline:IOS微信浏览器支持小窗内播放]
[preload:预加载][x5-video-player-type:启用同层H5播放器,就是在视频全屏的时候,div可以呈现在视频层上,方便延续触控操作]
[x5-video-player-fullscreen:全屏设置。它又两个属性值,ture和false,true支持全屏播放,false不支持全屏播放][poster:背景图片]-->
</div>
<div style="position:absolute;top:30vh;width:100vw;height:auto;text-align:center;z-index:666;" id="logo_img">
<img src="logoc.png" style="width:70vw;height: auto;text-align:center;">
</div>
<div style="position:absolute;top:5vh;width:100vw;height:auto;text-align:center;z-index:666;display:none;" id="logo_imgs">
<img src="logoc.png" style="width:70vw;height: auto;text-align:center;">
</div>
<div style="position:absolute;top:2vh;left:2vw;width:20vw;height:auto;z-index:999;">
<img src="logod.png" style="width:100%;height:auto;">
</div>
<div id="msgs">
<span style="position:absolute;top:50px;left:10px;color:#fff;font-size:10px;">Toggle【Auto】/【Loop】</span>
<span style="position:absolute;top:65px;left:10px;color:#fff;font-size:10px;">Swipe right to show tips</span>
<span style="position:absolute;top:80px;left:10px;color:#fff;font-size:10px;">Swipe left to hide tips</span>
<span style="position:absolute;top:95px;left:10px;color:#fff;font-size:10px;">Swipe up for next</span>
<span style="position:absolute;top:110px;left:10px;color:#fff;font-size:10px;">Swipe down for last</span>
<span style="position:absolute;top:125px;left:10px;color:#fff;font-size:10px;">Click Source to change</span>
<span style="position:absolute;top:140px;left:10px;color:#fff;font-size:10px;">Click heart to add favorite</span>
<span style="position:absolute;top:155px;left:10px;color:#fff;font-size:10px;">Click to play/pause/span>
<span style="position:absolute;top:170px;left:10px;color:#fff;font-size:10px;">Double click for fullscreen</span>
</div>
<div id="texts" style="color:#ffffff;">
<span style="position:absolute;bottom:72px;left:10px;;font-size:1.25rem;" id="userid">@51Sec</span>
<span style="position:absolute;bottom:35px;left:10px;font-size:9px;">51sec.org<br> http://xjj.51sec.org<br>
<span style="color:red;font-size:7px;" id="msg">51sec-|-Loading enviroment, please wait!</span></span>
</div>
<span style="position:absolute;top:5px;right:10px;font-family:electronicFont;color:#fff;font-size:1.2rem;" id="time">00:00:00</span>
<div id="buttons" style="position:absolute;bottom:150px;right:10px;z-index:999">
<button id="auto_btn" style="border-radius:20px;width:36px;height:32px;">Loop</button>
<br><br><br>
<button id="yuan" style="border-radius:20px;width:56px;height:48px;">Change Source</button>
<br><br><br>
<button style="border-radius:20px;width:56px;height:32px;" onclick="pass();">PASS</button>
<br><br><br>
<img style="border-radius:10px;width:32px;height:32px;" src="./img/love.png" title="点击添加收藏" id="love_btn"/>
</div>
<div>51Sec Apps</div>
<script async src="https://fundingchoicesmessages.google.com/i/pub-5660349373091698?ers=1" nonce="71EKVshklXofUN3O1mph_A"></script><script nonce="71EKVshklXofUN3O1mph_A">(function() {function signalGooglefcPresent() {if (!window.frames['googlefcPresent']) {if (document.body) {const iframe = document.createElement('iframe'); iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;'; iframe.style.display = 'none'; iframe.name = 'googlefcPresent'; document.body.appendChild(iframe);} else {setTimeout(signalGooglefcPresent, 0);}}}signalGooglefcPresent();})();</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5660349373091698"
crossorigin="anonymous"></script>
<!-- Ezoic - bottom_of_page 129 - bottom_of_page -->
<div id="ezoic-pub-ad-placeholder-129">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5660349373091698"
crossorigin="anonymous">
</script>
</div>
<!-- End Ezoic - bottom_of_page 129 - bottom_of_page -->
<span id="ezoic-pub-video-placeholder-1"></span>
<!--Site Start Time-->
<center>
<br />
</span>
<span class="nav-item">
<a class="nav-link" href="https://blog.51sec.org/2022/11/create-tiktok-style-web-app-using.html" target="_blank">
<span id="timeDate">Up Days...</span><span id="times">Up Time...</span> <script language="javascript">
var now = new Date();
function createtime(){
var grt= new Date("05/27/2022 00:00:00");/*---这里是网站的启用时间--*/
now.setTime(now.getTime()+250);
days = (now - grt ) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerHTML = "This site has been running "+dnum+" days ";
document.getElementById("times").innerHTML = hnum + " hours " + mnum + " minutes " + snum + " seconds.";
}
setInterval("createtime()",250);
</script>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js"></script>
<script>
$(document).ready(function(){
setInterval('var hour = new Date().getHours();var minutes = new Date().getMinutes();var seconds = new Date().getSeconds();if( hour < 10 ){ hour = "0"+hour; }if( minutes < 10 ){ minutes = "0"+minutes; }if( seconds < 10 ){ seconds = "0"+seconds; }$("#time").html(hour+":"+minutes+":"+seconds);', 1000);
setTimeout(function(){$("#msgs").hide();},10000);
layer.msg('Loading environment, please wait');
auto = false;//循环播放模式
textstf = true;//用户信息显示状态
gi = 1;//初始化GET链接序号
gi_max = 4;//最大GET链接序号
vdnum = 0;//初始化GET链接数量
url = "./get/get1.php";
vdurlold = new Array("demo.mp4");
vdurl_arr = new Array("demo.mp4");
player = document.getElementById("player");
players();
layer.msg('Load media, click to start playing', {
btn: ['Fullscreen', 'Watch Like this'],yes:function(){
toggleFullScreen();layer.closeAll();player.play();
}
});
//用户账号缓存
var user = $.cookie('user');
if (user != null) {
$("#userid").html('@'+user);
} else {
$("#userid").html('@51Sec');
}
//播放结束事件
player.onended = function() {
if (auto == false) {//播放结束,执行重播!
player.play();
} else {//播放结束,重新获取数据!
pass();
$("#msg").html("Completed play, reloading, pelase wait!");
}
}
});
//播放模式选择
$("#auto_btn").on("click", function(){
auto = !auto;console.log(auto);
this.innerText = (auto ? 'Auto' : 'Loop');
});
//收藏按钮事件
$("#love_btn").on("click", function(){
user = $.cookie('user');
if (user == null) {
login();
} else {
$.post("post.php",{userid:user,datastr:vdurl},function(love_data,status){
love_data = JSON.parse(love_data);
if (love_data.status == "YES") {
$("#love_btn").attr('src','./img/loves.png');
layer.msg(love_data.message);
}else{
layer.msg(love_data.message, {icon: 5});
}
});
}
});
//点击用户名事件
$("#userid").on("click", function(){
user = $.cookie('user');
if (user == null) {
login();
} else {
$.removeCookie('user'); //删除cookie
$("#userid").html("@51Sec");
layer.msg("亲,您已退出登录了哟!", {icon: 0});
}
});
//播放源按钮事件
$("#yuan").on("click", function(){
user = $.cookie('user');
if (gi < gi_max) {//小于最大链接序号,持续增加序号值
gi++;
this.innerText = "Source 0" + gi;//置播放源名称
if (gi>9) {this.innerText = "Source 0" + gi;}//大于9,缺省0
if (gi==2) {this.innerText = "Source JSON";}//自定义名称
if (user != null) {//登录状态,添加USER信息鉴权
url = "./get/get" + gi + ".php?user=" + user;
} else {//非登录状态
url = "./get/get" + gi + ".php";
}
} else if (gi = gi_max) {//等于最大链接序号,初始化序号值
if (user != null) {//登录状态显示收藏源
gi = 0;url = ("./get/get.php?user=" + user);
this.innerText = "收藏";
} else {//非登录状态,显示推荐源
gi = 1;url = "./get/get" + gi + ".php";
this.innerText = "Source 01";
}
}
});
//PASS切换事件
function pass(){
setTimeout(function () {
players();
}, 257);
}
//GET播放链接
function players() {
vdurl="demo.mp4";
if (player.readyState > 2) {//(audio/video)元素的就绪状态
if(player.played.end(0) > 5){//观看时长大于 5 秒,添加历史记录
vdurlold.unshift(player.currentSrc);
console.log(vdurlold);
}
}
layer.msg('Working hard to load data···', {icon: 16,shadeClose: true,});
if (vdnum != 0) {
$("#logo_img").hide();
$("#msgs").hide();
$("#logo_imgs").show();
}
vdnum++;
$.get(url,function(vdurl_data,status){
if (status==status) {
$("#msg").html("Data load completed. Playing!");
vdurl = vdurl_data;
player.src = vdurl;
console.log(vdurl);
if (gi==0) {
$("#love_btn").attr('src','./img/loves.png');
} else {
$("#love_btn").attr('src','./img/love.png');
}
if (vdurl_arr.indexOf(vdurl) >= 1) {//相同播放链接,重新加载
$("#msg").html("Same media link,reloading!");
layer.msg('Same media link,reloading!', {icon: 16,shadeClose: true,});
pass();
return;
}
console.log(vdurl_arr.indexOf(vdurl));
player.onstalled = function() {//媒体数据不可用,重新加载
$("#msg").html("Source media failed to reach, reloading!");
layer.msg('Failed to reach source media, reloading!', {icon: 16,shadeClose: true,});
pass();
return;
};
if(vdurl.indexOf("M3U8") >= 0 || vdurl.indexOf("m3u8") >= 0 || vdurl.indexOf("jpg") >= 0) {//m3u8格式判断,注意PC端不可用,如需pc端支持,需加载HLS.JS或者其他支持插件服务
layer.closeAll();
$("#logo_img").hide();
$("#logo_imgs").hide();
if (textstf==true) {
$("#texts").show();
}else{
$("#texts").hide();
}
$("#love_btn").hide();
$("#msg").html("Data load completed. Playing!");
player.play();
vdurl_arr.unshift(vdurl);
console.log(vdurl_arr);
}else{
$.ajax({url: vdurl,type: 'GET',complete: function(response) {
if(response.status != 200) {//测试链接通信状态
$("#msg").html("Source media failed to reach, reloading!");
layer.msg('Failed to reach source media, reloading!', {icon: 16,shadeClose: true,});
pass();
}else{
layer.closeAll();
$("#logo_img").hide();
$("#logo_imgs").hide();
if (textstf==true) {
$("#texts").show();
}else{
$("#texts").hide();
}
$("#love_btn").show();
$("#msg").html("Data load completed. Playing!");
player.play();
vdurl_arr.unshift(vdurl);
console.log(vdurl_arr);
}
}});
}
} else {
$("#msg").html("Failed load. Request it again. Please wait!");
pass();
}
});
}
//历史链接播放
function playold() {
player.src = vdurlold[0];
vdurlold.shift();
if (vdurlold[0] != null) {
player.play();
$("#msg").html("正在努力加载历史播放数据,请稍候!");
$("#love_btn").attr('src','./img/loves.png');
if(vdurlold[0].indexOf("M3U8") >= 0 || vdurlold[0].indexOf("m3u8") >= 0) {
$("#love_btn").hide();
}else{
$("#love_btn").show();
}
}else{
layer.msg("亲,您的历史播放记录已经全部观看完了,<br>正在重新发起请求,请稍候!", {icon: 0});
$("#msg").html("读取完毕,正在重新发起请求,请稍候!");
pass();
}
}
//账户登录
function login(){
layer.prompt({title: '请输入您的账户名,并确认'}, function(val, index){
layer.close(index);
$.post("login.php",{username:val},function(login_data,status){
login_data = JSON.parse(login_data);
if (login_data.status == "YES") {
$.cookie('user', val);
$("#userid").html('@'+val);
layer.msg(login_data.message, {icon: 6});
}else{
layer.msg(login_data.message, {icon: 5});
}
});
});
}
//点击屏幕事件
$("#player").click(function(){
if (player.paused) {
$("#logo_img").hide();
player.play();
$("#msgs").hide();
if (textstf==true) {
$("#texts").show();
}else{
$("#texts").hide();
}
} else {
$("#logo_img").show();
player.pause();
$("#texts").show();
$("#msgs").show();
}
});
$("#logo_img").click(function(){
if (player.paused) {
$("#logo_img").hide();
player.play();
} else {
$("#logo_img").show();
player.pause();
}
});
$("#logo_img").dblclick(function(){
toggleFullScreen();
});
$("#player").dblclick(function(){
toggleFullScreen();
});
//进入全屏,建议使用EDGE浏览器
function toggleFullScreen() {
if (!document.fullscreenElement &&
!document.mozFullScreenElement && !document.webkitFullscreenElement) {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
}
</script>
<script>
//触摸屏幕手势
var startx, starty; //获得角度
function getAngle(angx, angy) {
return Math.atan2(angy, angx) * 180 / Math.PI;
};
function getDirection(startx, starty, endx, endy) { //根据起点终点返回方向 1向上 2向下 3向左 4向右 0未滑动
var angx = endx - startx;
var angy = endy - starty;
var result = 0;
if (Math.abs(angx) < 2 && Math.abs(angy) < 2) { //如果滑动距离太短
return result;
}
var angle = getAngle(angx, angy);
if (angle >= -135 && angle <= -45) {
result = 1;
} else if (angle > 45 && angle < 135) {
result = 2;
} else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
result = 3;
} else if (angle >= -45 && angle <= 45) {
result = 4;
}
return result;
}
document.addEventListener("touchstart",function(e) { //手指接触屏幕
startx = e.touches[0].pageX;
starty = e.touches[0].pageY;
},false);
document.addEventListener("touchend",function(e) { //手指离开屏幕
var endx, endy;
endx = e.changedTouches[0].pageX;
endy = e.changedTouches[0].pageY;
var direction = getDirection(startx, starty, endx, endy);
switch (direction) {//1向上 2向下 3向左 4向右 0未滑动
case 1:
players();
break;
case 2:
playold();
break;
case 3:
$('#texts').hide();
textstf = !textstf;
break;
case 4:
$('#texts').show();
textstf = !textstf;
break;
}
},false);
</script>
</html>