-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
2953 lines (2659 loc) · 97.1 KB
/
index.php
File metadata and controls
2953 lines (2659 loc) · 97.1 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
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html >
<link rel="shortcut icon" href="favicon.ico" type="image/png">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gintas View v1.3</title>
<link rel="stylesheet" type="text/css" href="style.css" media="all"/>
<link rel="stylesheet" type="text/css" href="jquery-ui.css" media="all" />
<script type='text/javascript' src="jquery-1.10.2.js"></script>
<script type='text/javascript' src='jquery-1.7.1.js'></script>
<script type='text/javascript' src="jquery.min.js"></script>
<script type='text/javascript' src="jquery-ui.js"></script>
<script type='text/javascript' src='alljavascript.js'></script>
<script type='text/javascript' src="vidcontrol.js"></script>
<style type="text/css">
@font-face {
font-family: "AUFont";
src: url(/fonts/AUPassata_Bold.ttf) format("truetype");
}
@font-face {
font-family: "AURegFont";
src: url(/fonts/AUPassata_Rg.ttf) format("truetype");
}
html, body, input, button, p, div, textarea, label, span {
font-family: "AUFont";
}
.ui-slider-horizontal .ui-slider-handle { /* makes the slider handle smaller */
top: -0.5em;
margin-left: -0.2em;
}
.ui-slider .ui-slider-handle {
position: absolute;
z-index: 2;
width: 0.3em;
height: 1.5em;
cursor: default;
z-index: 101;
}
.ui-slider-tick-mark{
display:inline-block;
width:5px;
background:black;
height:24px;
position:absolute;
top:-4px;
z-index: 100;
}
.videorotate {
-moz-transform:rotate(90deg);
-webkit-transform:rotate(90deg);
-o-transform:rotate(90deg);
-ms-transform:rotate(90deg);
transform:rotate(90deg);
}
</style>
<script>
$(function() {
$( "#slider2" ).slider();
});
$(document).ready(function (){
$("#fit").click(function (){
$('html, body').animate({
scrollTop: $("#vid1").offset().top
}, 500);
});
});
</script>
<?php
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$platform = 'Unknown';
if (preg_match('/linux/i', $u_agent)) {
$platform = 'Linux';
}
elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
$platform = 'Mac';
}
elseif (preg_match('/windows|win32/i', $u_agent)) {
$platform = 'Windows';
};
?>
</head>
<body bgcolor="#1A171B" class="disab" >
<div id="box" style="text-align:center; background-color:#87888A;" hidden>
<span style="text-align:center;">Loading videos...</span>
<div>
<img src="728.GIF" style="position:relative; width:45px; height:auto;"></img>
</div>
</div>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" height="0" width="0">
<defs>
<filter id="blur" x="0" y="0">
<feGaussianBlur stdDeviation="3" />
</filter>
</defs>
</svg>
<div id="container">
<div id="header">
<div id="bbb">
<div align="left" id="sslogo" style="width:600px;">
<a href="index.php"><img style="width:30%;height:30%;" src="SkejSimlogo_name.png" alt="SkejSim"></a>
<div style="float:right;" >
<a style="color:#FFFFFF;font-size:24px;">Gintas View
<span>
<a style="text-decoration:none;color:#FFFFFF;font-size:24px;" href="news.php" target="_blank">v1.3 </a>
<span style="color:#FFFFFF;font-size:10px"> for <?php echo $platform; ?></span>
</a>
</div>
</div>
<div align="right" style="margin-top:-10px;" >
<a style="color:#FFFFFF;font-size:14px;text-decoration:none;color:#FFFFFF;" href="tag.php" target="_blank">Tag times</a>
</div>
</div>
<div id="spacer"></div>
<div id="main"><?php if(!isset($_POST['selection'])) { ?>
<div align="center">
<span style="font-size:20px;">Please select a video file.</span>
</div><?php } ?>
<div id="leftcol_container" >
<div class="leftcol">
<div class="leftcol">
<?php if(isset($_POST['selection'])) { ?>
<div>
<button class="submitbutton" id="fit">Fit to screen</button>
</div><?php } ?>
<span style="font-size:16px;color:#FFFFFF;"><?php if(!isset($_POST['selection'])) { ?>Select a video here:</span><?php } ?>
<?php // echo "<div id='labas'><span id='videofile'>". $filedate . "</span></div>";
if(isset($_POST['selection'])) { ?>
<span>Select another video:<?php } ?></span>
<form class="green" action="" method="post"> <!-- from this form we will have a value in $_POST['selection'] -->
<?php
if ($platform == "Windows") {
date_default_timezone_set('Europe/Copenhagen');
} else {
if ($platform == "Linux") {
date_default_timezone_set('Europe/London');
}
}
// The code below is needed to figure out what user is using computer. It will put the user to variable,
//so later system will automatically search for files in user's home directory, not in "gintas" home directory.
$handle = @fopen("/userr.txt", "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
list( $user, $value ) = explode( ' ', trim($buffer) );
$$user = $value; //Double $$ to set a var with the string name in $key
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail\n";
}
fclose($handle);
}
// End of putting user into a variable
// if WINDOWS
if ($platform == "Windows") {
$camerasconnected = 0;
$scdirE = 'E:/';
if (is_dir($scdirE)){
// Open a directory, and read its contents
error_reporting(E_ALL);
$dh = opendir($scdirE);
while (false !== ($scfilename = readdir($dh))) {
$scfiles[] = $scfilename;
}
if ($scfiles[0] == 'DCIM' || $scfiles[1] == 'DCIM' || $scfiles[2] == 'DCIM' || $scfiles[3] == 'DCIM' ) {
$subdir = $scdirE . $scfiles[0];
$dh2 = opendir($subdir);
while (false !== ($scfilename2 = readdir($dh2))) {
$scfiles2[] = $scfilename2;
}
if ($scfiles2[0] == '100GOPRO' || $scfiles2[1] == '100GOPRO' || $scfiles2[2] == '100GOPRO' || $scfiles2[3] == '100GOPRO' ) {
$mediadir1 = "E";
$files1 = glob("gopromediaE/DCIM/100GOPRO", GLOB_ONLYDIR); //gets all directories in E:/
}
} else {
echo "<br>No success.. (E:/)";
}
$cam_dir1 = $files1[0];
switch ($mediadir1) {
/*case "ED":
$cam_dir2 = "gopromediaE";
$cam_dir3 = "gopromediaF";
$cam_dir4 = "gopromediaG";
break;*/
case "E":
$cam_dir2 = "gopromediaF";
$cam_dir3 = "gopromediaG";
$cam_dir4 = "gopromediaH";
break;
case "F":
$cam_dir2 = "gopromediaG";
$cam_dir3 = "gopromediaH";
$cam_dir4 = "gopromediaI";
break;
case "G":
$cam_dir2 = "gopromediaH";
$cam_dir3 = "gopromediaI";
$cam_dir4 = "gopromediaJ";
break;
case "H":
$cam_dir2 = "gopromediaI";
$cam_dir3 = "gopromediaJ";
$cam_dir4 = "gopromediaK";
case "I":
$cam_dir2 = "gopromediaJ";
$cam_dir3 = "gopromediaK";
$cam_dir4 = "gopromediaL";
break;
break;
default:
echo "Could not locate cameras' directories.";
}
} else {
echo "<span style='color:#FFF;'>Could not recognize a camera as E:/ drive!</span>";
error_reporting(E_ALL & ~E_NOTICE);
}
}
// WINDOWS FINISHED
// if LINUX
if ($platform == "Linux"){
$dir = '/gopromedia/' . $user; //need to find a solution how to find cameras directories when they appear not in /media/gintas
$files1 = glob("$dir/BD*", GLOB_ONLYDIR); //gets all directories which starts with "BC" names.
//Puts all 4 cameras directories (BC*) to 4 variables.
$cam_dir1 = $files1[0];
$cam_dir2 = $files1[1];
$cam_dir3 = $files1[2];
$cam_dir4 = $files1[3];
}
// LINUX FINISHED
function get_media($base_dir, $extentions = array('mp4')) { // Gets all media files with mp4 extensions
if(!file_exists($base_dir)) return array(); //from all folders and subfolders
$extensions = implode('|', $extentions);
$directory = new RecursiveDirectoryIterator($base_dir);
$iterator = new RecursiveIteratorIterator($directory);
$regex = new RegexIterator($iterator, "/^.+\.$extensions$/i", RecursiveRegexIterator::GET_MATCH);
$ret = array();
$i = 0;
foreach ($regex as $filename=>$object) {
$ret[$i]['filename'] = $filename;
$ret[$i]['filetime'] = filemtime($filename);
$i++;
}
return $ret;
}
//outputs the list of files, sorted by date, named by modification date, to the "select" tag.
$thelist = '<select size="1" name="selection">';
$prevValue = NULL;
foreach (get_media("$cam_dir1", array('mp4')) as $file) {
$posOfPeriod = strrpos($file['filename'], ".");
$last3digits = substr($file['filename'], $posOfPeriod -4, 4);
if (is_numeric($last3digits)) {
$curValue = $last3digits;
// if ($curValue == $prevValue) {
// echo "";
// } else {
// echo "Numeric: " . $last3digits . "<br>";
// }
}
// else {
// echo "Non-Numeric: " . $last3digits . "<br>";
// }
if ($curValue == $prevValue) {
$thelist .= '<option style="display:none;" value="'.$file['filename'].'">'.date("Y-m-d H:i",$file['filetime']).'</option>';
} else {
$thelist .= '<option value="'.$file['filename'].'">'.date("Y-m-d H:i",$file['filetime']).'</option>';
}
$prevValue = $curValue;
}
$thelist .= '</select>';
echo $thelist;
//Code for first camera stream end//
if(isset($_POST['selection'])) {
$filename = $_POST['selection']; //puts selected files name into variable filename.
}
if(isset($_POST['selection'])) { //if the file IS selected, then:
if (file_exists($filename)) { //check if file actually exists. If yes, then:
if ($platform == "Windows") {
date_default_timezone_set('Europe/Copenhagen');
} else {
if ($platform == "Linux") {
date_default_timezone_set('Europe/London');
}
}
$filedate = date("Y-m-d H:i", filemtime($filename)); //take file modification date and put it in variable filedate.
//echo $filename;
require('/getID3/getid3/getid3.php');
$getID3 = new getID3; //get selected video duration
$file = $getID3->analyze($filename);
$videoduration = $file['playtime_string'];
//echo("Duration: ".$videoduration);
$posOfPeriods2 = strrpos($filename, ".");
$last3digitss2 = substr($filename, $posOfPeriods2 -4, 4);
//echo "<br>searching for: " . $last3digitss2;
$prevValue2 = $last3digitss2;
$indic = 0;
$totallength = 0;
echo "<br><div id='samevideoswrapper' style='text-align:left;'>"; //creates a container where all video parts will be placed
foreach (get_media("$cam_dir1", array('mp4')) as $file) { //checks if file's last numbers are the same
$posOfPeriods = strrpos($file['filename'], "."); //gets each file name's last 4 digits
$last3digitss = substr($file['filename'], $posOfPeriods -4, 4);
if (is_numeric($last3digitss)) {
$curValue2 = $last3digitss;
}
$getID3 = new getID3; //checks video duration of each video
$file = $getID3->analyze($file['filename']);
$duration = $file['playtime_string'];
$indic++;
if ($curValue2 == $prevValue2) { //if file name's last numbers are the same, then
// puts video parts path to input element, so JavaScript could read them later and change tags.
echo "<input class='samevideo' hidden id='same1video" . $indic . "' type='text' style='background-color:#ECF6CE;text-align:left;width:85%;' value='" . $cam_dir1 . "/" . $file['filename'] . "'/>" ;
${"video1part$indic"} = $cam_dir1 . "/" . $file['filename']; //assigns a variable with video path which will be used to switch videos.
$samevideodate = date("Y-m-d H:i", filemtime($cam_dir1 . "/" . $file['filename']));
$vidp[$indic] = $indic; //for testing purposes. Counting of video parts; Do not delete!
//echo "<br>the same > " . $indic; //needed to check which file's number is the same from list (to see if it recognized the right files);
$str_time = $duration;
$str_time = preg_replace("/^([\d]{1,2})\:([\d]{2})$/", "00:$1:$2", $str_time); //converts duration of video from mm:ss to seconds only.
sscanf($str_time, "%d:%d:%d", $hours, $minutes, $seconds);
$duration = $hours * 3600 + $minutes * 60 + $seconds;
echo "<input class='videolength' hidden id='videolength" . $indic . "' type='text' style='text-align:right; width:10%;' value='" . $duration . "'/>"; // outputs video chopped part duration;
$totallength = $totallength + $duration; //sets total video duration (from chopped parts);
$camera2videos = glob("$cam_dir2/DCIM/100GOPRO/*.*4");
foreach ($camera2videos as $camera2video) { //puts same videos paths from camera 2 into input elements
$camera2videotime = date("Y-m-d H:i", filemtime($camera2video));
$samevideodate1 = new DateTime($samevideodate);
$anewfiledate2 = new DateTime($camera2videotime);
$ainterval1 = $samevideodate1->diff($anewfiledate2);
$anewInterval1 = $ainterval1->format('%i');
if ($anewInterval1 < 4) {
$same2video = $camera2video;
echo "<input class='samevideo' hidden id='same2video" . $indic . "' type='text' style='background-color:#F7BE81; text-align:left; width:85%;' value='" . $same2video . "'/>" ;
}
}
$camera3videos = glob("$cam_dir3/DCIM/100GOPRO/*.*4");
foreach ($camera3videos as $camera3video) { //puts same videos paths from camera 3 into input elements
$camera3videotime = date("Y-m-d H:i", filemtime($camera3video));
$samevideodate1 = new DateTime($samevideodate);
$anewfiledate2 = new DateTime($camera3videotime);
$ainterval1 = $samevideodate1->diff($anewfiledate2);
$anewInterval1 = $ainterval1->format('%i');
if ($anewInterval1 < 4) {
$same3video = $camera3video;
echo "<input class='samevideo' hidden id='same3video" . $indic . "' type='text' style='background-color:#A9E2F3; text-align:left; width:85%;' value='" . $same3video . "'/>" ;
}
}
$camera4videos = glob("$cam_dir4/DCIM/100GOPRO/*.*4");
foreach ($camera4videos as $camera4video) { //puts same videos paths from camera 4 into input elements
$camera4videotime = date("Y-m-d H:i", filemtime($camera4video));
$samevideodate1 = new DateTime($samevideodate);
$anewfiledate2 = new DateTime($camera4videotime);
$ainterval1 = $samevideodate1->diff($anewfiledate2);
$anewInterval1 = $ainterval1->format('%i');
if ($anewInterval1 < 4) {
$same4video = $camera4video;
echo "<input class='samevideo' hidden id='same4video" . $indic . "' type='text' style='background-color:#F5A9E1; text-align:left; width:85%;' value='" . $same4video . "'/>" ;
}
}
} else { //if file's last numbers are not the same
//echo "<br>NOT the same > " . $indic; //needed to check which file's number is NOT the same from list (to see if it recognized the right files);
//echo "<input class='videolength' id='videolength" . $indic . "' type='text' style='text-align:right;' value='" . $duration . "'/>"; //outputs video duration;
}
}
echo "</div>";
echo "<input hidden class='totallength' id='totallength' type='text' style='text-align:right; width:10%' value='" . $totallength ."' />"; //outputs total video duration;
echo "<input hidden class='videocount' id='videocount' type='text' style='text-align:right; width:10%' value='" . count($vidp) ."' />"; //for testing purposes. Prints how many video parts there are.
}
}
echo "<p>";
//Code for second camera stream
if(isset($_POST['selection'])) {
date_default_timezone_set("Europe/Copenhagen");
$filedatetimestamp = strtotime($filedate);
}
//$filedatetimestamp = strtotime('2014-06-27 09:48');
$files2 = glob("$cam_dir2/DCIM/100GOPRO/*.*4"); //gets all file names which end with "4" in second camera directory
foreach ($files2 as $filename2) {
$filedate2 = date("Y-m-d H:i", filemtime($filename2));
if(isset($_POST['selection'])) {
$newfiledate1 = new DateTime($filedate); //takes $filedate time and makes it as a new time; puts in variable
$newfiledate2 = new DateTime($filedate2); //takes $filedate2 time and makes it as a new time; puts in variable
$interval1 = $newfiledate1->diff($newfiledate2); //calculates the time difference (interval) between two newly created variables
$newInterval1 = $interval1->format('%i'); //outputs the value in numberic format (1,2,3, etc..)
if ($newInterval1 < 4) { //if the difference between two newly created times are less than 6, then
$file2 = $filename2; //put filename2 to file2 variable
}
}
}
//Code for second camera stream end//
//Code for third camera stream//
$files3 = glob("$cam_dir3/DCIM/100GOPRO/*.*4"); //gets all file names which end with "4" in third camera directory
foreach ($files3 as $filename3) {
$filedate3 = date("Y-m-d H:i", filemtime($filename3));
if(isset($_POST['selection'])){
$newfiledate3 = new DateTime($filedate3); //takes $filedate3 time and makes it as a new time; puts in variable
$interval2 = $newfiledate1->diff($newfiledate3); //calculates the time difference (interval) between two newly created variables
$newInterval2 = $interval2->format('%i'); //outputs the value in numberic format (1,2,3, etc..)
if ($newInterval2 < 4){ //if the difference between two newly created times are less than 6, then
$file3 = $filename3; //puts filename3 to file3 variable
}
}
}
//Code for third camera stream end//
//Code for fourth camera stream//
$files4 = glob("$cam_dir4/DCIM/100GOPRO/*.*4"); //gets all file names which end with "4" in fourth camera directory
foreach ($files4 as $filename4) {
$filedate4 = date("Y-m-d H:i", filemtime($filename4));
if(isset($_POST['selection'])){
$newfiledate4 = new DateTime($filedate4); //takes $filedate4 time and makes it as "time"; puts in variable
$interval3 = $newfiledate1->diff($newfiledate4); //calculates the time difference (interval) between two newly created variables
$newInterval3 = $interval3->format('%i'); //outputs the value in numberic format (1,2,3, etc..)
if ($newInterval3 < 4){
$file4 = $filename4; //puts filename4 to file4 variable
}
}
}
//Code for fourth camera stream end//
?>
<input type="submit" class="submitbutton" value=" Select "/>
<input type="hidden" name="vtime"/>
</form>
<?php if(isset($_POST['selection'])) { ?>
<div id="cont1" class="rightcol">
<img id="imgcont11" class="vidimage contimages" src="red01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont111" class="vidimage contimages" src="yellow01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont12" class="vidimage contimages" src="red02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont122" class="vidimage contimages" src="yellow02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont13" class="vidimage contimages" src="red03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont133" class="vidimage contimages" src="yellow03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont14" class="vidimage contimages" src="red04.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont144" class="vidimage contimages" src="yellow04.png" style="display:none; z-index:0; position: absolute; " />
<img id="fullc11" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc12" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc13" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc14" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="blurc11" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc12" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc13" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc14" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="aud11" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute1();" />
<img id="aud12" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute2();"/>
<img id="aud13" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute3();"/>
<img id="aud14" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute4();"/>
</div>
<div id="cont2" class="rightcol">
<img id="imgcont21" class="vidimage contimages" src="red01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont211" class="vidimage contimages" src="yellow01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont22" class="vidimage contimages" src="red02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont222" class="vidimage contimages" src="yellow02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont23" class="vidimage contimages" src="red03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont233" class="vidimage contimages" src="yellow03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont24" class="vidimage contimages" src="red04.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont244" class="vidimage contimages" src="yellow04.png" style="display:none; z-index:0; position: absolute; " />
<img id="fullc21" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc22" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc23" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc24" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="blurc21" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc22" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc23" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc24" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="aud21" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute1();"/>
<img id="aud22" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute2();"/>
<img id="aud23" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute3();"/>
<img id="aud24" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute4();"/>
</div>
<div id="cont3" class="rightcol">
<img id="imgcont31" class="vidimage contimages" src="red01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont311" class="vidimage contimages" src="yellow01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont32" class="vidimage contimages" src="red02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont322" class="vidimage contimages" src="yellow02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont33" class="vidimage contimages" src="red03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont333" class="vidimage contimages" src="yellow03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont34" class="vidimage contimages" src="red04.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont344" class="vidimage contimages" src="yellow04.png" style="display:none; z-index:0; position: absolute; " />
<img id="fullc31" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc32" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc33" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc34" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="blurc31" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc32" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc33" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc34" class="vidimage fullimages contimages fullcont" src="blur.png" style="display:none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="aud31" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute1();"/>
<img id="aud32" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute2();"/>
<img id="aud33" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute3();"/>
<img id="aud34" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute4();"/>
</div>
<?php } ?>
</div>
</div>
</div>
<?php if(isset($_POST['selection'])) { // This will hide the video before submission ?>
<table class="vid">
<tr>
<td colspan="2" style="width:10px;">
<div class="maincol">
<div id="vid1" >
<img id="aud1" class="vidimage fullimages" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute1();"/>
<img id="fullscreenvid1" class="vidimage fullimages" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<!--<img id="rotate" class="vidimage fullimages" src="rotate.png" style=" z-index:1; margin-left: 52px; width:26px; height:26px; position: absolute; " />-->
<img id="blur1" class="vidimage fullimages" src="blur.png" style="display:none; z-index:1; margin-top:26px; width:28px; height:28px; position:absolute; " />
<img id="img1" class="vidimage images redimages" src="red01.png" style="display:none; z-index:0; position: absolute; " />
<img id="img11" class="vidimage images" src="yellow01.png" style="display:none; z-index:0; position: absolute; " />
<video id="Video1" class="videos" style="z-index:0;" >
<source src="<?php $file1 = $_POST['selection']; $file1 = str_replace('\\', '/', $file1); echo $file1; ?>" type="video/mp4"></source>
Browser does not support HTML5. Video could not be loaded.
</video>
</div>
</div>
<div class="maincol_bottom"></div>
</td>
<td >
<div class="maincol">
<div id="vid2" >
<img id="aud2" class="vidimage fullimages" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute2();"/>
<img id="fullscreenvid2" class="vidimage fullimages" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="blur2" class="vidimage fullimages" src="blur.png" style="display: none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="img2" class="vidimage images redimages" src="red02.png" style="display:none; z-index:0; position: absolute; " />
<img id="img22" class="vidimage images" src="yellow02.png" style="display:none; z-index:0; position: absolute; " />
<video id="Video2" class="videos" style="z-index:0;">
<source src="<?php if(isset($file2)) { echo $file2; }; ?>" type="video/mp4"></source>
Browser does not support HTML5. Video could not be loaded.
</video>
</div>
</div>
<div class="maincol_bottom"></div>
</tr>
<tr>
<td colspan="3" style="text-align:center" id="center">
<div class="maincol" id="cont4">
<img id="imgcont41" class="vidimage contimages" src="red01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont411" class="vidimage contimages" src="yellow01.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont42" class="vidimage contimages" src="red02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont422" class="vidimage contimages" src="yellow02.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont43" class="vidimage contimages" src="red03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont433" class="vidimage contimages" src="yellow03.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont44" class="vidimage contimages" src="red04.png" style="display:none; z-index:0; position: absolute; " />
<img id="imgcont444" class="vidimage contimages" src="yellow04.png" style="display:none; z-index:0; position: absolute; " />
<img id="fullc41" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc42" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc43" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="fullc44" class="vidimage fullimages contimages fullcont" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="blurc41" class="vidimage fullimages contimages fullcont" src="blur.png" style="display: none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc42" class="vidimage fullimages contimages fullcont" src="blur.png" style="display: none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc43" class="vidimage fullimages contimages fullcont" src="blur.png" style="display: none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="blurc44" class="vidimage fullimages contimages fullcont" src="blur.png" style="display: none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="aud41" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute1();"/>
<img id="aud42" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute2();"/>
<img id="aud43" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute3();"/>
<img id="aud44" class="vidimage fullimages contimages fullcont" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute4();"/>
</div>
<div class="maincol_bottom"></div>
</td>
</tr>
<tr>
<td colspan="2" style="width:10px;">
<div class="maincol">
<div id="vid3" >
<img id="aud3" class="vidimage fullimages" src="audio.png" style="display:none; z-index:1; margin-top: 53px; width:26px; height:26px; position: absolute; " onclick="mute3();"/>
<img id="fullscreenvid3" class="vidimage fullimages" src="fullscreen.png" style="display:none; z-index:1; margin-left: 26px; width:26px; height:26px; position: absolute; " />
<img id="blur3" class="vidimage fullimages" src="blur.png" style="display: none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="img3" class="vidimage images redimages" src="red03.png" style="display:none; z-index:0; position: absolute; " />
<img id="img33" class="vidimage images" src="yellow03.png" style="display:none; z-index:0; position: absolute; " />
<video id="Video3" class="videos" style="z-index:0;">
<source src="<?php if(isset($file3)) { echo $file3; }; ?>" type="video/mp4"></source>
Browser does not support HTML5. Video could not be loaded.
</video>
</div>
</div>
<div class="maincol_bottom"></div>
</td>
<td >
<div class="maincol">
<div id="vid4">
<img id="aud4" class="vidimage fullimages" src="audio.png" style="display:none; z-index:1; margin-top:53px; width:26px; height:26px; position: absolute; " onclick="mute4();"/>
<img id="fullscreenvid4" class="vidimage fullimages" src="fullscreen.png" style="display:none; z-index:1; margin-left:26px; width:26px; height:26px; position: absolute; " />
<img id="blur4" class="vidimage fullimages" src="blur.png" style="display: none; z-index:1; margin-top: 26px; width:28px; height:28px; position: absolute; " />
<img id="img4" class="vidimage images redimages" src="red04.png" style="display:none; z-index:0; position: absolute; " />
<img id="img44" class="vidimage images" src="yellow04.png" style="display:none; z-index:0; position: absolute; " />
<video id="Video4" class="videos" style="z-index:0;">
<source src="<?php if(isset($file4)) { echo $file4; }; ?>" type="video/mp4"></source>
Browser does not support HTML5. Video could not be loaded.
</video>
</div>
</div>
<?php } ?>
</div>
<div class="maincol_bottom"></div>
</td>
</tr>
<div class="maincol_bottom"></div>
</table>
<script>
var firstplay = 1;
</script>
<div>
<!-- here was the timetag output test place -->
</div>
<div id="rightcol_container">
<div class="maincol_bottom"></div>
</div>
<div class="clear"></div>
<table width="100%" class="vid">
<tr>
<td style="width:10px;" ></td>
<td style="width:30%;padding-top:5px;padding-right:1px;text-align:right;">
<?php if(isset($_POST['selection'])) { ?>
<label for="amount2">Time: </label>
<td style="padding-top:5px;padding-left:1px;text-align:left;">
<input type="text" id="amount2" style="border: 0 none;border-radius: 4px 4px 4px 4px;color: #F6931F;padding-left: 9px;width: 60px;height:20px;font-size:18px;"> <?php echo "Playing video: " . $filedate; } ?>
</td>
</td>
</tr>
<tr>
<td style="width:10px;padding-top:12px;" >
<div style="background-color:transparent;" class="maincol" id="playbuttoncol">
<?php if(isset($_POST['selection'])) { ?>
<div>
<input id="playpausebutton" onClick="playpause();" type="button" class="playpausebtn"/>
</div>
</div>
<td colspan="2" style="text-align:top;" id="timeline">
<div style="background-color:transparent;" class="maincol" id="timelinecol">
<div id="slider2" style="width:100%;z-index:99;" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"></div>
</div>
<div class="maincol_bottom"></div>
</td>
</tr>
<tr>
<td>
<div style="background-color:transparent;" class="maincol">
<input id="resetbutton" value="" onClick="resetclock();" type="button" class="resetbtn" />
</div>
<?php } ?>
</td>
</tr>
<div class="maincol_bottom"></div>
</table>
<div id="footer"></div>
<div id="testcontainer" class="selectable" style="clear:both;"> <!--background-color:grey; -->
<br>
<input id="changer" hidden value=""/>
<?php if(isset($_POST['selection'])) {
$mysqli = new mysqli('localhost','gopro','gopro','timetagging'); // Establish database connection
//$query = "SELECT timetag FROM timetags WHERE date='$filedate' ORDER BY id ASC"; // Query to check the last session number
$query = "SELECT timetag FROM timetags WHERE timestamp BETWEEN $filedatetimestamp-300 AND $filedatetimestamp+300";
$n = 1;
if ($result = mysqli_query($mysqli, $query)) { // If there is no error
$row_cnt = $result->num_rows;
//echo "<br>Rows: " . $row_cnt;
while ($row = $result->fetch_row()) {
foreach ($row as $rowvalue){
$timetag[$n] = $rowvalue; ?>
<script type="text/javascript">
<?php
echo "var time" . $n . " = " . $timetag[$n] . ";";
echo "var n = " . $n . ";";?>
</script>
<?php
$n++;
}
}
} else {
echo "<br>Could not load the timetags:<br> (" . $mysqli->errno . ") " . $mysqli->error; // Output error on screen
}
}
/*
$date111 = date("Y-m-d H:i", 1410511560);
$timestamp211 = strtotime('2014-09-12 09:46');
$timestamp212 = strtotime('2014-09-12 09:47');
echo "<br>Date: = " . $date111;
echo "<br>Timestamp 2014-09-12 09:46 = " . $timestamp211;
echo "<br>Timestamp 2014-09-12 09:47 = " . $timestamp212;
$date111 = date("Y-m-d H:i", 1412168859);
echo "<br>Timestamp of 2014-09-12 07:53 (is) = " . $timestamp11;
echo "<br>Timestamp of 2014-09-12 09:53 (should be) = " . $timestamp22;
echo "<br>Time of 1412168859 (is) = " . $date111;
$timestamp1 = strtotime('2014-06-26 18:11');
$timestamp2 = strtotime('2014-06-26 18:22');
if(isset($_POST['selection']))
{
echo '===== TEST CONTAINER =====';
echo "<br>sss";
}
*/
?>
</div>
<script type="text/javascript">
$(document).ready(function (){
/*for (ind2 = 1; ind2 <= videocount; ind2++) {
videopart[ind2] = document.getElementById('samevideo' + ind2).value;
}*/
videocount = document.getElementById('videocount').value;
parts = document.getElementById('videocount').value;
totallength = document.getElementById("totallength");
if (parts > 1) {
for (i = 1; i <= videocount; i++) { //puts paths to video parts into variables.
window['video1part' + i] = document.getElementById('same1video' + i).value;
window['video2part' + i] = document.getElementById('same2video' + i).value;
window['video3part' + i] = document.getElementById('same3video' + i).value;
window['video4part' + i] = document.getElementById('same4video' + i).value;
window['videolength' + i] = document.getElementById('videolength' + i).value;
/*
console.log('video4part' + i + ': ' + window['video4part' + i] );
*/
}
}
});
parts = document.getElementById('videocount').value;
var video1 = document.querySelector('#Video1');
var video2 = document.querySelector('#Video2');
var video3 = document.querySelector('#Video3');
var video4 = document.querySelector('#Video4');
var videos = document.getElementById('.videos');
window.onload= $(function() {
var after;
var currentpart = 1;
var indic = 0;
totallength = document.getElementById("totallength");
maxvalue = document.getElementById("main").clientWidth;
video1 = document.getElementById("Video1");
video2 = document.getElementById("Video2");
video3 = document.getElementById("Video3");
video4 = document.getElementById("Video4");
setTimeout(function(){$("#slider2").slider("option", "max", totallength.value)},330);
$( "#slider2" ).slider({
step: 1,
animate: true,
min: 0,
range: "min",
slide: function ( event, ui ) {
stoptime = ui.value * 1000;
window.clearTimeout(refresh);
flagplaying = 1;
if (flagclock==0) {
if (flagplaying == 1) {
playpause();
playpause();
video1.play() & video2.play() & video3.play() & video4.play();
playpause.value = 'Pause';
flagstop = 1;
}
} else {
if (flagplaying == 0) {
video1.pause() & video2.pause() & video3.pause() & video4.pause();
playpause.value = 'Play';
playpause();
playpause();
flagclock = 0;
}
}
if (flagplaying == 1) {
playpause();
//var playpause = document.getElementById('playpausebutton');
//setTimeout(function(){playpause.click();},380);
video1.play() & video2.play() & video3.play() & video4.play();
playpause.value = 'Pause';
flagstop = 1;
}
if (parts = 1) {
video1.currentTime = ui.value;
video2.currentTime = ui.value;
video3.currentTime = ui.value;
video4.currentTime = ui.value;
}
if (parts > 1) {
$('#Video1').on('ended', function (event) {
currentpart++;
video1 = document.getElementById("Video1");
video2 = document.getElementById("Video2");
video3 = document.getElementById("Video3");
video4 = document.getElementById("Video4");
playpause();
video1.setAttribute("src", window['video1part' + currentpart] );
video2.setAttribute("src", window['video2part' + currentpart] );
video3.setAttribute("src", window['video3part' + currentpart] );
video4.setAttribute("src", window['video4part' + currentpart] );
//video1.pause() & video2.pause() & video3.pause() & video4.pause();
console.log(window['video1part' + currentpart]);
console.log(window['video2part' + currentpart]);
console.log(window['video3part' + currentpart]);
console.log(window['video4part' + currentpart]);
//console.log('indic: ' + indic);
indic = 1;
console.log('new indic: ' + indic);
var ready = 0;
var v1canplay0 = 0;
var v2canplay0 = 0;
var v3canplay0 = 0;
var v4canplay0 = 0;
function video1ready0() {
if (video1.readyState == 4) {
//video1.currentTime = ui.value - videolength1 + 1;
$('#Video1').on('canplay', function (event) {
console.log('v1 canplay0');
v1canplay0 = 1;
});
} else {
v1canplay0 = 0;
setTimeout(function(){ video1ready0(); }, 800);
}
}
video1ready0();
function video2ready0() {
if (video2.readyState == 4) {
//video2.currentTime = ui.value - videolength1 + 1;
$('#Video2').on('canplay', function (event) {
console.log('v2 canplay0');
v2canplay0 = 1;
});
} else {
v2canplay0 = 0;
setTimeout(function(){ video2ready0(); }, 800);
}
}
video2ready0();
function video3ready0() {
if (video3.readyState == 4) {
//video3.currentTime = ui.value - videolength1 + 1;
$('#Video3').on('canplay', function (event) {
console.log('v3 canplay0');
v3canplay0 = 1;
});
} else {
v3canplay0 = 0;
setTimeout(function(){ video3ready0(); }, 800);
}
}
video3ready0();
function video4ready0() {
if (video4.readyState == 4) {
//video4.currentTime = ui.value - videolength1 + 1;
$('#Video4').on('canplay', function (event) {
console.log('v4 canplay0');
v4canplay0 = 1;
});
} else {
v4canplay0 = 0;
setTimeout(function(){ video4ready0(); }, 800);
}
}
video4ready0();
function canplay0() {
if (v1canplay0 == 1 && v2canplay0 == 1 && v3canplay0 == 1 && v4canplay0 == 1) {
$("#box").dialog("close");
$("#box").dialog("close");
playpause();
playpause();
video1.play() & video2.play() & video3.play() & video4.play();
$("#playpausebutton").css('background', 'url(pause.png) no-repeat top right');
$("#playpausebutton").css('background-size', '48px 48px');
} else {
//console.log('checking: ' + i);
video1.pause() & video2.pause() & video3.pause() & video4.pause();
setTimeout(function(){ canplay0(); }, 1000);
i++;
}
}
canplay0();
});
if (ui.value < videolength1) {
currentpart = 1;
//console.log('on first part');
video1.currentTime = ui.value;
video2.currentTime = ui.value;