-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbbbnbnbnbnbnb.html
996 lines (945 loc) · 46.3 KB
/
bbbnbnbnbnbnb.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
#a+div{
width: 100px;
height: 100px;
background: yellow;
}
.ccc{
width: 50%;
margin: 100px auto;
}
#a{
width: 100px;
height: 36px;
color: #fff;
font-size: 26px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: lightblue;
line-height: 36px;
text-align: center;
} #b{
width: 100px;
height: 36px;
color: #fff;
font-size: 26px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: yellowgreen;
text-align: center;
line-height: 36px;
} #c{
width: 100px;
height: 36px;
color: #fff;
font-size: 26px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: lightcoral;
text-align: center;
line-height: 36px;
}
#d{
width: 100px;
height: 36px;
color: #fff;
font-size: 26px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: lightsalmon;
text-align: center;
line-height: 36px;
}
#e{
width: 100px;
height: 36px;
color: #fff;
font-size: 22px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: lime;
text-align: center;
line-height: 36px;
}
#f{
width: 100px;
height: 36px;
color: #fff;
font-size: 22px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: slategrey;
text-align: center;
line-height: 36px;
}
#g{
width: 100px;
height: 36px;
color: #fff;
font-size: 22px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: violet;
text-align: center;
line-height: 36px;
}
#h{
width: 100px;
height: 36px;
color: #fff;
font-size: 22px;
font-weight: bold;
display: inline-block;
text-decoration:none;
border-radius: 5px;
margin-right: 10px;
background: lightblue;
text-align: center;
line-height: 36px;
}
</style>
</head>
<body>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3D2YBIH_yraoqvNIKPH2AdGWkAVTyKDpCNCGJZ84JB5hZq2JUZ1WMfMvx2Ms1O6ZK7KGvSWEaQtPapWy9eINeYGIVTgI0kx1CCnZJGvcHVDNdE0lqRsdBxqa9CndoLnomJHAxYmhIGvsgjoSc5xFQw4CZPeW-PiSvneBOlCsnXIWA%26timestamp%3D1527843193%26roomtype%3D3" target="view_window">Web老师</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3D2YBIH_yraoqvNIKPH2AdGWkAVTyKDpCNvR2Fs-IBsz0wHo9ACi92UvBSlp8LGSQsb6zAPe93sSyKyU6nSDlBgKlbL14g15gY4Y1VaBq31F6dkka9wdUM1_S5Ly7S7i6QfeRkcNUyxFnZ-_7rBSIhjCa1Y-QQ_PkaHBnk994QTYASzt6PbxMnZA%26timestamp%3D1528099423%26roomtype%3D3" target="view_window">Web学生</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3D2YBIH_yraoqvNIKPH2AdGWkAVTyKDpCNHLUItAEj2TYYpMd_GWQN9KgmPk_X7J1w6Dc0Xmkj9XgEeMgCVneCT5PlrrlzUEhIk1Ok2gzC8Gyc38M9YWgMe2HfzzI9dlEMIF8JuiEkqeWhBjt4VnleRe8TSyMsCouh_fOOBHDfJvZ2oAowuYlRzF--dNYowpGpAmuQ5lXbWOc%26timestamp%3D1527843441%26roomtype%3D3" target="view_window">Web助教</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3D2YBIH_yraoqvNIKPH2AdGWkAVTyKDpCNnYtpyDO-V7hBh20wYKHJsoZRsICsYFZ9rklDG8jky8KsVhythgrmQ33kZHDVMsRZ2fv-6wUiIYwmtWPkEPz5Goc7h4JOMYrEeMZ79tJNV8I%26timestamp%3D1527857837%26roomtype%3D3" target="view_window">Web巡课</a>
<hr>
<div class="ccc">
<a id="a" href="enterroom://192.168.1.228:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3D2YBIH_yraoqvNIKPH2AdGWkAVTyKDpCNCGJZ84JB5hZq2JUZ1WMfMvx2Ms1O6ZK7KGvSWEaQtPapWy9eINeYGIVTgI0kx1CCnZJGvcHVDNdE0lqRsdBxqa9CndoLnomJHAxYmhIGvsgjoSc5xFQw4CZPeW-PiSvneBOlCsnXIWA%26timestamp%3D1527843193%26roomtype%3D3×tamp=1519700612&roomtype=×tamp=1503559121&endtype=1&debug=true"> 老师 </a>
<a id="b" href="enterroom://192.168.1.228:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3D2YBIH_yraoqvNIKPH2AdGWkAVTyKDpCNvR2Fs-IBsz0wHo9ACi92UvBSlp8LGSQsb6zAPe93sSyKyU6nSDlBgKlbL14g15gY4Y1VaBq31F6dkka9wdUM1_S5Ly7S7i6QfeRkcNUyxFnZ-_7rBSIhjCa1Y-QQ_PkaHBnk994QTYASzt6PbxMnZA%26timestamp%3D1528099423%26roomtype%3D3×tamp=1519700933&roomtype=3×tamp=1503559121&endtype=1&debug=true"> 学生 </a>
<a id="c" href="enterroom://192.168.1.228:8444/publish/index.html#/login?host=cn.talk-cloud.neiwang%26domain%3Dtest%26param%3DUaToBLfsrWcl4XKyTtlYAx0XMLXLVHMn6Vmmf-CGkWR27TsfvbO1a7YXvFF8LBYnM0FxNcEt8wg15NDR1_DhoJOhdzZWKMK9_Uf-du-RAPVIJboPhAx-4B7P2_3wNoEqr0Tgw7sxl1UR_CtRLjIFf9vk-fZMVoZJ5f7yY1oU4ws%26timestamp%3D1522137226%26roomtype%3D3×tamp=1519700933&roomtype=3×tamp=1503559121&endtype=1&debug=true"> 助教 </a>
<a id="d" href="enterroom://192.168.1.228:8444/publish/index.html#/login?host=cn.talk-cloud.neiwang%26domain%3Dtest%26param%3DUaToBLfsrWcl4XKyTtlYAx0XMLXLVHMnLTLHuGo3nYV7DKbIY83AgGyhqblOhxrv7vFlns3aOQy7oJWe9zbhfBH1xZBCJCLhdWhuqNtdz4rI0NioVtN-_CDuacvBUwOIuMx7bdLeE3y8Dnd6YBegronqWc_A5NvyNmdB4obydanI5kY-AgG5-HGKORW60F7E%26timestamp%3D1522306099%26roomtype%3D3&refresh_thirdid=f0eb3d4b-b6df-383c-f665-4c66ec813edd×tamp=1519700933&roomtype=3×tamp=1503559121&endtype=1&debug=true"> 巡课 </a>
<hr>
<a id="e" href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Drocky%26param%3DlZbKuYFWx2GkPs88YJQCFDqWfQLbx477-nQCJMwt_p6wuL8KbkWrFhHvOGZdxfiRRzFGCk4KZIYJgQoy8iE8y8leU6IOS4ocuiHE0TBY9SdMLTcKxVTdtWJ26DsGDSYSRKG4gieQlDgDJTGSO-Zf32E_kMJmTFNgcFs5kAW9D4A%26timestamp%3D1527837963%26roomtype%3D3" target="view_window">Web老师</a>
<a id="f" href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Drocky%26param%3DlZbKuYFWx2GkPs88YJQCFDqWfQLbx477nKCFcX0d79oeDwQjW1Qefh9SClL_yFyVrpAo29IdGEWF32JgjLLZUFMahzRVaWvaEEE2PpsZFd7cc-ylmCAqRXnO2dUlzKVvSs_ZB_dQUzMXA91RBLDsnQ%26timestamp%3D1527838901%26roomtype%3D3" target="view_window">Web学生</a>
<a id="g" href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Drocky%26param%3DlZbKuYFWx2GkPs88YJQCFDqWfQLbx477LBH8UEJvqGPTq6F7KkCwhT852SpQasoN-VU0OB43ZcrERyn7q8s6Z-3unoInzbiteLd_hC4wKr4NM5WUk30KEgsONreuwMg05DK2UaiJvf1pjPe83uj-esOH1_o1KfMfOQsvrhH7dK654NRoyMoy9XfguLthgAskidTQ-MGkP7Q%26timestamp%3D1527838770%26roomtype%3D3" target="view_window" >Web助教</a>
<a id="h" href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Drocky%26param%3DlZbKuYFWx2GkPs88YJQCFDqWfQLbx4773UBXEsvRx6XWDPw99tmN86mbrMdhrL9QcFv1Ih7Dgp3WBqlFIuhUoxM-InCrrjCLvqiLGwCvCIQQQTY-mxkV3txz7KWYICpFec7Z1SXMpW-H5lVXYhAPGsGwz4pKuI0-%26timestamp%3D1527838848%26roomtype%3D3" target="view_window" >Web巡课</a>
</div>
<a href="enterroom://192.168.1.108:8444/publish/index.html#/login?host=cn.talk-cloud.neiwang%26domain%3Dlike%26param%3DehNnsP9RWpaQVmtP2zOe_iDyv2cDQ5JAhYy3f2h9GvkyN-R9Z9cc2XU8qLj6KJPvPY8caMbicEW7e-iNibco9RCyW7iTOHFiBsc72DsKWMqzvB6cHx0-PUvXeL_6n_WC0Lnor1RgTrdQojyv-UHmxnOd1PBiCTyf%26timestamp%3D1523345381%26roomtype%3D3&refresh_thirdid=ee403ce1-21a0-2a18-a911-489d9ad2b7ab">test</a>
<a id="z" href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Dlkl%26param%3DmKmELb7syNgqSZz2VPirCNcLWJJPAORo99QkCRVdWHaGTdG-EdCpag-E7EmZpiJRbwsEAHMbOw-cMJSEVuR-ZVQy9SL74ylOqp7Z-mcvbm7o_M_4CtutmBLsoPA4nV-nL0lhfsRFgKKCRtAo6mBtXw%26timestamp%3D1525752231%26roomtype%3D0&refresh_thirdid=89f7f5e5-e899-daca-b568-b1b9c2a4a19e" target="view_window">lkl老师</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Dlkl%26param%3DmKmELb7syNgqSZz2VPirCNcLWJJPAORoJveetD3TmjN5JI3fo8MMpPgbZA-fwbv9WM9eb45JR496NnLtqfxONdoo6b5gABuF48c6HFWCam0Qbw8T3GJPYJ9di1tHttOCTudkcQOvRKA7yOBYaeWWZF9ViskJbM4h%26timestamp%3D1525752562%26roomtype%3D0&extradata={'group':'A','publicGroup':'AA'}
"> 东边的太阳A</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Dlkl%26param%3DmKmELb7syNgqSZz2VPirCNcLWJJPAORoJveetD3TmjN5JI3fo8MMpPgbZA-fwbv9WM9eb45JR496NnLtqfxONdoo6b5gABuF48c6HFWCam0Qbw8T3GJPYJ9di1tHttOCTudkcQOvRKA7yOBYaeWWZF9ViskJbM4h%26timestamp%3D1525752562%26roomtype%3D0&extradata={'group':'B','publicGroup':'BB'}
"> 东边的太阳B</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Dlkl%26param%3DmKmELb7syNgqSZz2VPirCNcLWJJPAORoJveetD3TmjN5JI3fo8MMpPgbZA-fwbv9WM9eb45JR496NnLtqfxONdoo6b5gABuF48c6HFWCam0Qbw8T3GJPYJ9di1tHttOCTudkcQOvRKA7yOBYaeWWZF9ViskJbM4h%26timestamp%3D1525752562%26roomtype%3D0&extradata={'group':'C','publicGroup':'CC'}
"> 东边的太阳B</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Dlkl%26param%3DmKmELb7syNgqSZz2VPirCNcLWJJPAORo1kFM6UrSksyBJi1OtVL3flADDckyzv3YbSzU3va4KJNwefQwbTtR2m8LBABzGzsPnDCUhFbkfmUC2jxceSMJSIwZufIcPUE1JXJJ0nTG14tEuuN_N2ZWH9aRKzJHevEUdGa_-wc82L4%26timestamp%3D1525761439%26roomtype%3D3&extradata={'group':'A','publicGroup':'AA'}
">西边的雨</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=global.talk-cloud.neiwang%26domain%3Dlkl%26param%3DmKmELb7syNgqSZz2VPirCNcLWJJPAORo1kFM6UrSksyBJi1OtVL3flADDckyzv3YbSzU3va4KJNwefQwbTtR2m8LBABzGzsPnDCUhFbkfmUC2jxceSMJSIwZufIcPUE1JXJJ0nTG14tEuuN_N2ZWH9aRKzJHevEUdGa_-wc82L4%26timestamp%3D1525761439%26roomtype%3D3&extradata={'group':'B','publicGroup':'BB'}
">西边的雨</a>
<a href="https://192.168.1.228:8444/publish/index.html#/login?host=cn.talk-cloud.neiwang%26domain%3Dtest%26param%3DUaToBLfsrWcl4XKyTtlYAx0XMLXLVHMn6Vmmf-CGkWR27TsfvbO1a7YXvFF8LBYnM0FxNcEt8wg15NDR1_DhoJOhdzZWKMK9_Uf-du-RAPVIJboPhAx-4B7P2_3wNoEqr0Tgw7sxl1UR_CtRLjIFf9vk-fZMVoZJ5f7yY1oU4ws%26timestamp%3D1522137226%26roomtype%3D3&extradata={'group':'C','publicGroup':'CC'}&roleClassTeacher=true
">西边的雨</a>
https://192.168.1.85:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3Dw-onCnVIuvZCl_6MX8zzRtLN2vpMLNXh-u0JA9zm8jWpWy9eINeYGIVTgI0kx1CCnZJGvcHVDNdE0lqRsdBxqa9CndoLnomJHAxYmhIGvsgjoSc5xFQw4Jk4RdfCJFoBuuDcIFWgtu8%26timestamp%3D1523343798%26roomtype%3D0
https://192.168.1.85:8444/publish/index.html#/login?host=democn.talk-cloud.net%26domain%3Dnewtest%26param%3Dw -onCnVIuvZCl_6MX8zzRtLN2vpMLNXhYLl7TCw8udGpWy9eINeYGOGNVWgat9RenZJGvcHVDNcE0CKCt35C5a9CndoLnomJHAxYmhIGvsgjoSc5xFQw4Jk4RdfCJFoB8TGXU7E-Qew%26timestamp%3D1523343978%26roomtype%3D0
<div>royal</div>
</body>
</html>
/**qweqweqweqweqweqweqweqweqweqweqwqwqweqweqweqweqewqwqweqweqweqweqweqweqweqwqweqweqweqweqweqweqweqweqweqweqweqweqwe
* @module CommonVideoSmart
* @description 提供 CommonVideoSmart组件
* @author xiagd
* @date 2017/12/13
*/
'use strict';
import React from 'react';
import ServiceRoom from 'ServiceRoom';
import TkConstant from 'TkConstant';
import CoreController from 'CoreController';
import TkUtils from 'TkUtils';
import ServiceSignalling from 'ServiceSignalling';
import eventObjectDefine from 'eventObjectDefine';
import TkGlobal from 'TkGlobal';
import WebAjaxInterface from 'WebAjaxInterface';
import VideoDumb from "../../../components/video/realVideo";
import { DragSource, DropTarget } from 'react-dnd';
import Audiochange from "../../from/Audiochange";
git config --global.email "[email protected]"
git config --global user.email "[email protected]"
git config --global user.name "GiantKs"
const specSource = {
beginDrag(props, monitor, component) {
const {id, percentLeft, percentTop, isDrag} = props;
return {id, percentLeft, percentTop, isDrag};
},
canDrag(props, monitor) {
const {id , hasDragJurisdiction} = props;
if(!hasDragJurisdiction || TkGlobal.isVideoStretch ) { //视频没有拽出并且是学生,或者寻课,或者没有上课,或者是视频拉伸,则不能拖拽//tkpc2.0.8
return false;
} else {
return true;
}
},
};
function collect(connect, monitor) {
return {
connectDragSource: connect.dragSource(),
connectDragPreview: connect.dragPreview(),
isDragging: monitor.isDragging(),
isCanDrag: monitor.canDrag(),
getItem:monitor.getItem(),
};
}
const specTarget = {
drop(props, monitor, component) {
let dragFinishEleCoordinate = monitor.getSourceClientOffset(); //拖拽后鼠标相对body的位置
const item = monitor.getItem(); //拖拽的元素信息
let {id} = item;
const defalutFontSize = TkGlobal.windowInnerWidth / TkConstant.STANDARDSIZE;
let dragEle = document.getElementById(id); //拖拽的元素
let dragEleW = dragEle.clientWidth;
let dragEleH = dragEle.clientHeight;
let content = document.getElementById('lc-full-vessel'); //白板拖拽区域
let contentW = content.clientWidth;
let contentH = content.clientHeight;
/*拖拽元素不能拖出白板区*/
let dragEleOffsetLeft = dragFinishEleCoordinate.x;
let dragEleOffsetTop = dragFinishEleCoordinate.y;
let dragEleLeft,dragEleTop;
if (TkGlobal.mainContainerFull || TkGlobal.isVideoInFullscreen) {//如果白板区全屏
if (dragEleOffsetLeft < 0) {
dragEleOffsetLeft = 0;
}else if (dragEleOffsetLeft > (contentW-dragEleW)) {
dragEleOffsetLeft = contentW-dragEleW;
}
if (dragEleOffsetTop < 0) {
dragEleOffsetTop = 0;
}else if (dragEleOffsetTop > (contentH - dragEleH)) {
dragEleOffsetTop = contentH - dragEleH;
}
/*计算位置百分比*/
dragEleLeft = dragEleOffsetLeft/(contentW - dragEleW);
dragEleTop = dragEleOffsetTop/(contentH - dragEleH);
}else {//白板区没有全屏
if (dragEleOffsetLeft < TkGlobal.dragRange.left*defalutFontSize) {
dragEleOffsetLeft = TkGlobal.dragRange.left*defalutFontSize;
}else if (dragEleOffsetLeft > (TkGlobal.dragRange.left*defalutFontSize+contentW-dragEleW)) {
dragEleOffsetLeft = TkGlobal.dragRange.left*defalutFontSize+contentW-dragEleW;
}
<hr>
if (dragEleOffsetTop < TkGlobal.dragRange.top*defalutFontSize) {
dragEleOffsetTop = TkGlobal.dragRange.top*defalutFontSize;
}else if (dragEleOffsetTop > (TkGlobal.dragRange.top*defalutFontSize + contentH - dragEleH)) {
dragEleOffsetTop = TkGlobal.dragRange.top*defalutFontSize + contentH - dragEleH;
}
/*计算位置百分比*/
dragEleLeft = (dragEleOffsetLeft - TkGlobal.dragRange.left*defalutFontSize)/(contentW - dragEleW);
dragEleTop = (dragEleOffsetTop - TkGlobal.dragRange.top*defalutFontSize)/(contentH - dragEleH);
}
dragEleLeft = (isNaN(dragEleLeft) || dragEleLeft === Infinity || dragEleLeft === null )?0:dragEleLeft;
dragEleTop = (isNaN(dragEleTop) || dragEleTop === Infinity || dragEleTop === null )?0:dragEleTop;
let dragEleStyle = { //相对白板区位置的百分比
percentTop: dragEleTop,
percentLeft: dragEleLeft,
isDrag: true,
};
if(id === 'page_wrap' || id === 'lc_tool_container' || id === 'timerDrag' || id === 'dialDrag' || id === 'answerDrag' || id === 'moreBlackboardDrag' || id === 'responderDrag' || id === 'studentResponderDrag' || id === 'coursewareRemarks') {
eventObjectDefine.CoreController.dispatchEvent({ //自己本地改变拖拽的video位置
type: 'otherDropTarget',
message: {data: {id: item.id, style: dragEleStyle}},
});
} else {
eventObjectDefine.CoreController.dispatchEvent({ //自己本地和通知别人改变拖拽的video位置
type: 'changeOtherVideoStyle',
message: {data: {style: dragEleStyle, id: id}, initiative:true},
});
}
},
canDrop(props, monitor) { //拖拽元素不能拖出白板区
let {isDrag} = props;
if (isDrag) {
return true;
}else {
return false;
}
},
};
class CommonVideoSmart extends React.Component {
constructor(props) {
super(props);
this.state = {
networkDelay: 0,
networkDelayColor: "#41BF33",
updateState:false ,
hasNetworkState:true ,
};
this.lastVideoDragStyle = {};//保存拉伸视频前一次的位置百分比
this.listernerBackupid = new Date().getTime() + '_' + Math.random();
this.areaExchange = false;
this.maxVideoNumber = undefined;
};
componentDidMount() { //真实的DOM被渲染出来后调用
let {id} = this.props;
eventObjectDefine.CoreController.addEventListener(TkConstant.EVENTTYPE.RoomEvent.roomUserpropertyChanged, this.handlerRoomUserpropertyChanged.bind(this), this.listernerBackupid); //room-userproperty-changed事件-收到参与者属性改变后执行更新
eventObjectDefine.CoreController.addEventListener(TkConstant.EVENTTYPE.RoomEvent.roomPubmsg, this.handlerRoomPubmsg.bind(this), this.listernerBackupid); //room-pubmsg事件:
eventObjectDefine.CoreController.addEventListener(TkConstant.EVENTTYPE.RoomEvent.roomDelmsg, this.handlerRoomDelmsg.bind(this), this.listernerBackupid);
eventObjectDefine.CoreController.addEventListener('handleMyselfNetworkStatus', this.handleMyselfNetworkStatus.bind(this), this.listernerBackupid);
eventObjectDefine.CoreController.addEventListener(id + "_mouseMove", this.videoChangeSize.bind(this), this.listernerBackupid);
eventObjectDefine.CoreController.addEventListener(id + "_mouseUp", this.videoMouseUp.bind(this), this.listernerBackupid);
};
componentWillUnmount() { //组件被移除之前被调用,可以用于做一些清理工作
eventObjectDefine.CoreController.removeBackupListerner(this.listernerBackupid);
};
componentDidUpdate(prevProps, prevState) { //每次render结束后会触发
if(this.props.stream !== prevProps.stream && this.props.stream === undefined && this.hasNetworkState ){
this.setState({
hasNetworkState:false,
networkDelay: 0,
networkDelayColor: "#41BF33",
});
}else if(this.props.stream !== prevProps.stream && prevProps.stream === undefined && this.props.stream !== undefined && !this.hasNetworkState ){
this.setState({
hasNetworkState:true,
});
}
};
/*处理room-userproperty-changed事件*/
handlerRoomUserpropertyChanged(roomUserpropertyChangedEventData) {
let user = roomUserpropertyChangedEventData.user ;
if(this.props.stream && this.props.stream.extensionId === user.id){
let changePropertyJson = roomUserpropertyChangedEventData.message;
for(let key of Object.keys(changePropertyJson) ) {
if(key === 'publishstate' || key === 'disablevideo') { //发布状态改变时显示或者隐藏video
if((user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_VIDEOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH) && !user.disablevideo) {
this.props.stream.show();
} else {
this.props.stream.hide();
}
}
}
this.setState({updateState:!this.state.updateState});
}
};
handlerRoomPubmsg(recvEventData) {
let pubmsgData = recvEventData.message;
switch(pubmsgData.name) {
case "sendNetworkState":
let data = pubmsgData.data;
this._handleNetworkStatus(data);
break;
case "LowConsume":
this.maxVideoNumber = Number(pubmsgData.data.maxvideo);
break;
}
};
handlerRoomDelmsg(recvEventData) {
let delmsgData = recvEventData.message;
switch(delmsgData.name) {
case "sendNetworkState":
if(this.props.stream && this.props.stream.extensionId === delmsgData.id){
this.setState({
hasNetworkState:false,
networkDelay: 0,
networkDelayColor: "#41BF33",
});
}
break;
}
};
handleMyselfNetworkStatus(handleData) {
let data = handleData.message.data;
this._handleNetworkStatus(data);
};
_handleNetworkStatus(data) {
if(this.props.stream){
let extensionId = this.props.stream.extensionId;
if(data.extensionId === extensionId) {
let {packetsLost, rtt} = data.networkStatus;
this.state.networkDelay = rtt;
if(packetsLost > 5 && packetsLost <= 10) {
this.state.networkDelayColor = "#ff8b2b";
} else if(packetsLost > 10) {
this.state.networkDelayColor = "#ff021d";
} else {
this.state.networkDelayColor = "#41BF33";
}
this.setState({
networkDelay: this.state.networkDelay,
networkDelayColor: this.state.networkDelayColor,
hasNetworkState:true ,
});
}
}
};
/*改变用户的画笔权限*/
changeUserCandraw(userid) {
ServiceSignalling.changeUserCandraw(userid)
}
/*用户功能-上下讲台信令的发送*/
userPlatformUpOrDown(userid) {
ServiceSignalling.userPlatformUpOrDown(userid)
}
/*用户功能-打开关闭音频*/
userAudioOpenOrClose(userid) {
ServiceSignalling.userAudioOpenOrClose(userid)
}
/*用户功能-打开关闭视频*/
userVideoOpenOrClose(userid) {
ServiceSignalling.userVideoOpenOrClose(userid)
};
/*恢复拖拽位置*/
restoreVideoDrag(){
let {id, isDrag} = this.props;
if(isDrag) {
if (this.props.initOtherVideoDragByUserid && typeof this.props.initOtherVideoDragByUserid === "function") {
this.props.initOtherVideoDragByUserid(id);
}
}
};
//给学生发送礼物
sendGiftToStudent(userid) {
let user = ServiceRoom.getTkRoom().getUsers()[userid]; //根据userid获取用户信息
if(user && CoreController.handler.getAppPermissions('giveAloneUserSendGift')) {
let userIdJson = {};
if(user.role === TkConstant.role.roleStudent) { //如果是学生,则发送礼物
let userId = user.id;
let userNickname = user.nickname;
userIdJson[userId] = userNickname;
WebAjaxInterface.sendGift(userIdJson);
}
}
};
/*根据是否正在拖拽显示或隐藏ppt上的浮层*/
layerIsShowOfIsDraging(isDragging, isVideoStretch, getItem) {
let {id} = this.props;
if(isDragging || isVideoStretch) {
//layerIsShowOfDraging = false;
let newpptLayer = document.getElementById("ppt_not_click_newppt");
let h5DocumentLayer = document.getElementById("h5Document-layer");
if(newpptLayer) {
newpptLayer.style.display = 'block';
}
if(h5DocumentLayer) {
h5DocumentLayer.style.display = 'block';
}
} else {
if (getItem === null || (getItem && getItem.id === id)) {
let newpptLayer = document.getElementById("ppt_not_click_newppt");
let h5DocumentLayer = document.getElementById("h5Document-layer");
if(newpptLayer) {
newpptLayer.style.display = 'none';
}
if(h5DocumentLayer) {
h5DocumentLayer.style.display = 'none';
}
}
}
};
handlerAreaExchange(){
/*todo 区域交换这里需要修改,不能用延时*/
/* this.areaExchange = !this.areaExchange;
eventObjectDefine.CoreController.dispatchEvent({//自己本地改变拖拽的video位置
type:'areaExchange',
message: {
hasExchange: this.areaExchange,
}
});
let defalutFontSize = TkGlobal.windowInnerWidth / TkConstant.STANDARDSIZE ;
setTimeout(function(){
eventObjectDefine.Window.dispatchEvent({ type:TkConstant.EVENTTYPE.WindowEvent.onResize , message:{defalutFontSize:defalutFontSize} });
}, 20);*/
}
/*一键还原的函数*/
handlerOneKeyReset(){
eventObjectDefine.CoreController.dispatchEvent({//初始化视频框的位置(拖拽和分屏)
type:'oneKeyRecovery',
message: {}
});
}
/*缩放后发送位置*/
sendDragOfChangeVideoSize(id) {
const defalutFontSize = TkGlobal.windowInnerWidth / TkConstant.STANDARDSIZE;
let dragEle = document.getElementById(id); //拖拽的元素
let dragEleW = dragEle.clientWidth;
let dragEleH = dragEle.clientHeight;
let content = document.getElementById('lc-full-vessel'); //白板拖拽区域
let contentW = content.clientWidth;
let contentH = content.clientHeight;
/*计算位置百分比*/
let dragEleLeft = (dragEle.offsetLeft - TkGlobal.dragRange.left*defalutFontSize)/(contentW - dragEleW);
let dragEleTop = (dragEle.offsetTop - TkGlobal.dragRange.top*defalutFontSize)/(contentH - dragEleH);
// dragEleLeft = (isNaN(dragEleLeft) || dragEleLeft === Infinity || dragEleLeft === null)?0:dragEleLeft;
// dragEleTop = (isNaN(dragEleTop) || dragEleTop === Infinity || dragEleTop === null)?0:dragEleTop;
if (contentW === dragEleW) {
dragEleLeft = this.lastVideoDragStyle?this.lastVideoDragStyle.percentLeft:0;
}else if (isNaN(dragEleLeft) || dragEleLeft === null) {
dragEleLeft = 0;
}
if (contentH === dragEleH) {
dragEleTop = this.lastVideoDragStyle?this.lastVideoDragStyle.percentTop:0;
}else if (isNaN(dragEleTop) || dragEleTop === null) {
dragEleTop = 0;
}
let dragEleStyle = { //相对白板区位置的百分比
percentTop: dragEleTop,
percentLeft: dragEleLeft,
isDrag: true,
};
eventObjectDefine.CoreController.dispatchEvent({ //自己本地和通知别人改变拖拽的video位置
type: 'changeOtherVideoStyle',
message: {data: {style: dragEleStyle, id: id}, initiative:true},
});
}
/*鼠标在视频框上按下时*/
mouseDown(event) {
if(!CoreController.handler.getAppPermissions('isChangeVideoSize')) {
return;
}
let {id, isDrag, percentLeft, percentTop, videoWidth, videoHeight} = this.props;
if(isDrag) {
const defalutFontSize = TkGlobal.windowInnerWidth / TkConstant.STANDARDSIZE;
videoWidth = videoWidth*defalutFontSize;
videoHeight = videoHeight*defalutFontSize;
//获取视频框相对白板的位置:
let {videoLeft,videoTop} = this._percentageChangeToRem(percentLeft,percentTop,videoWidth/defalutFontSize,videoHeight/defalutFontSize);
//获取视频框相对body的位置:
let videoLeftOfbody = (videoLeft + TkGlobal.dragRange.left) * defalutFontSize;
let videoTopOfbody = (videoTop + TkGlobal.dragRange.top) * defalutFontSize;
//获取鼠标相对body的位置:
let mouseLeft = event.pageX;
let mouseTop = event.pageY;
//根据鼠标按下的位置判断是否可以拉伸:
if((mouseLeft >= videoLeftOfbody + videoWidth - 7 && mouseLeft < videoLeftOfbody + videoWidth) && (mouseTop >= videoTopOfbody && mouseTop < videoTopOfbody + videoHeight - 7)) {
TkGlobal.isVideoStretch = true; //是否是拉伸
} else if((mouseTop >= videoTopOfbody + videoHeight - 7 && mouseTop < videoTopOfbody + videoHeight) && (mouseLeft >= videoLeftOfbody && mouseLeft < videoLeftOfbody + videoWidth - 7)) {
TkGlobal.isVideoStretch = true; //是否是拉伸
} else if((mouseTop < videoTopOfbody + videoHeight && mouseTop >= videoTopOfbody + videoHeight - 7) && (mouseLeft < videoLeftOfbody + videoWidth && mouseLeft >= videoLeftOfbody + videoWidth - 7)) {
TkGlobal.isVideoStretch = true; //是否是拉伸
}
this.lastVideoDragStyle = {//保存拉伸视频前一次的位置百分比
percentLeft:percentLeft,
percentTop:percentTop,
}
}
};
/*鼠标在白板区抬起时*/
videoMouseUp(handleData) {
let {id, isDrag} = this.props;
if(isDrag) {
let event = handleData.message.data.event;
if(TkGlobal.isVideoStretch === true) {
if (this.props.sendSignallingOfVideoSize && typeof this.props.sendSignallingOfVideoSize === "function") {
this.props.sendSignallingOfVideoSize();//发送缩放信令
this.sendDragOfChangeVideoSize(id);//缩放后发送位置信令
}
this.lastVideoDragStyle = {//初始化鼠标按下时保存的百分比
percentLeft:0,
percentTop:0,
};
TkGlobal.isVideoStretch = false; //是否是拉伸
this.layerIsShowOfIsDraging(false, TkGlobal.isVideoStretch);
event.onmousemove = null;
event.target.style.cursor = "";//在页面上鼠标的样式初始化
TkGlobal.changeVideoSizeEventName = null;//在页面上鼠标移动时触发的事件名制空
TkGlobal.changeVideoSizeMouseUpEventName = null;//在页面上鼠标抬起时触发的事件名制空
this.setState({updateState:!this.state.updateState});//强制render
}
}
};
/*鼠标在白板区移动时*/
videoChangeSize(handleData) {
let event = handleData.message.data.event;
let {id, isDrag, percentLeft, percentTop, videoWidth, videoHeight } = this.props;
if(isDrag) {
const defalutFontSize = TkGlobal.windowInnerWidth / TkConstant.STANDARDSIZE;
//获取视频框相对body的位置:
videoWidth = videoWidth * defalutFontSize;
videoHeight = videoHeight * defalutFontSize;
let {videoLeft, videoTop} = this._percentageChangeToRem(percentLeft, percentTop, videoWidth / defalutFontSize, videoHeight / defalutFontSize);
let videoLeftOfbody = (videoLeft + TkGlobal.dragRange.left) * defalutFontSize;
let videoTopOfbody = (videoTop + TkGlobal.dragRange.top) * defalutFontSize;
//获取鼠标相对body的位置:
let mouseLeft = event.pageX;
let mouseTop = event.pageY;
//改变鼠标的样式
if (!TkGlobal.isVideoStretch) {
if ((mouseLeft >= videoLeftOfbody + videoWidth - 7 && mouseLeft <= videoLeftOfbody + videoWidth) && (mouseTop >= videoTopOfbody && mouseTop < videoTopOfbody + videoHeight - 7)) {
event.target.style.cursor = "w-resize";
this.stretchDirection = 'w';
} else if ((mouseTop >= videoTopOfbody + videoHeight - 7 && mouseTop <= videoTopOfbody + videoHeight) && (mouseLeft >= videoLeftOfbody && mouseLeft < videoLeftOfbody + videoWidth - 7)) {
event.target.style.cursor = "s-resize";
this.stretchDirection = 's';
} else if ((mouseTop < videoTopOfbody + videoHeight && mouseTop >= videoTopOfbody + videoHeight - 7) && (mouseLeft < videoLeftOfbody + videoWidth && mouseLeft >= videoLeftOfbody + videoWidth - 7)) {
event.target.style.cursor = "se-resize";
this.stretchDirection = 'se';
} else {
event.target.style.cursor = "";
}
} else {
event.target.style.cursor = "";
}
//改变视频框的大小
let newVideoWidth, newVideoHeight;
if (TkGlobal.isVideoStretch && (this.stretchDirection === "w" || this.stretchDirection === "se")) {
newVideoWidth = Math.abs(mouseLeft - videoLeftOfbody) / defalutFontSize;
newVideoHeight = newVideoWidth * 3 / 4;
if (mouseLeft < TkGlobal.dragRange.left * defalutFontSize || mouseLeft < videoLeftOfbody) {
let lcVideoContainer = document.getElementById('other_video_container');
let videoNum = TkConstant.template === 'template_sharktop'?7:6;
newVideoWidth = ((lcVideoContainer.clientWidth / defalutFontSize) / videoNum - 0.1);
newVideoHeight = newVideoWidth * 3 / 4;
}
if (this.props.changeVideoSize && typeof this.props.changeVideoSize === "function") {
this.props.changeVideoSize(newVideoWidth, newVideoHeight, id);
}
} else if (TkGlobal.isVideoStretch && this.stretchDirection === "s") {
newVideoHeight = Math.abs(mouseTop - videoTopOfbody) / defalutFontSize;
newVideoWidth = newVideoHeight * 4 / 3;
if (mouseTop < TkGlobal.dragRange.top * defalutFontSize || mouseTop < videoTopOfbody) {
let lcVideoContainer = document.getElementById('other_video_container');
let videoNum = TkConstant.template === 'template_sharktop'?7:6;
newVideoWidth = ((lcVideoContainer.clientWidth / defalutFontSize) / videoNum - 0.1);
newVideoHeight = newVideoWidth * 3 / 4;
}
if (this.props.changeVideoSize && typeof this.props.changeVideoSize === "function") {
this.props.changeVideoSize(newVideoWidth, newVideoHeight, id);
}
}
}
};
/*鼠标在视频框上移动时*/
mouseMove() {
if(!CoreController.handler.getAppPermissions('isChangeVideoSize')) {
return;
}
let {id, isDrag} = this.props;
if(TkGlobal.changeVideoSizeEventName !== id + "_mouseMove" && TkGlobal.changeVideoSizeMouseUpEventName !== id + "_mouseUp" && !TkGlobal.isVideoStretch && isDrag) {
TkGlobal.changeVideoSizeEventName = id + "_mouseMove"; //以id作为改变视频大小事件的名字
TkGlobal.changeVideoSizeMouseUpEventName = id + "_mouseUp";
}
}
_getUser(userid){
let user = undefined ;
if(ServiceRoom.getTkRoom() ){
user = ServiceRoom.getTkRoom().getUser(userid);
}
return user ;
}
_loadStreamInfo(stream){
let user = undefined , afterElementArray = [];
if(stream && stream.extensionId !== undefined && ServiceRoom.getTkRoom() ){
user = this._getUser(stream.extensionId) ;
}
return{
user ,
afterElementArray ,
}
};
_loadUserInfoIconArray(user){
let userInfoIconArray = [] ;
/*if( user.role === TkConstant.role.roleChairman){
return userInfoIconArray ;
}*/
let userInfoIconDesc = [
{
disabled: true,
isShow: user.role !== TkConstant.role.roleChairman,
className: 'v-user-pen ' + (user.candraw ? 'on' : 'off'),
},
{
disabled: true,
isShow: user.hasaudio?true:true,
className: 'v-device-microphone ' + ((user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_AUDIOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH) && user.hasaudio ? 'on' : 'off') + ' ' + (user.disableaudio ? 'disableaudio' : ''),
},
{
disabled: true,
isShow: user.hasvideo,
className: 'v-device-video ' + ((user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_VIDEOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH) ? 'on' : 'off') + ' ' + (user.disablevideo ? 'disablevideo' : ''),
}
];
userInfoIconDesc.map( (item , index) => {
let { disabled , isShow , className } = item ;
if(isShow){
userInfoIconArray.push(
<button key={index} className={(className ||'') + ' ' + (disabled ? ' disabled ' : ' ')} disabled={disabled} />
);
}
} );
return userInfoIconArray ;
}
_loadActionButtonArray(user){
let actionButtonArray = [] ;
let actionButtonDesc = [] ;
if(TkGlobal.playback){ //回放 不显示按钮
return actionButtonArray ;
}
let isMyself = user.id === ServiceRoom.getTkRoom().getMySelf().id ;
let closeMyseftAV = CoreController.handler.getAppPermissions('closeMyseftAV') ;
let controlOtherVideo = CoreController.handler.getAppPermissions('controlOtherVideo') ;
/*if( (!isMyself && !controlOtherVideo) || (isMyself && !closeMyseftAV) || (!isMyself && controlOtherVideo && user.role === TkConstant.role.roleChairman) ){
return actionButtonArray ;
}*/
let loadActionBtn = {};
if(!TkGlobal.classBegin){
if(TkConstant.joinRoomInfo.isBeforeClassReleaseVideo){
loadActionBtn = {
scrawl:false ,//画笔
platform:false,//上下台
audio:closeMyseftAV && isMyself,//音频
video:closeMyseftAV && isMyself,//视频
gift:false,//送礼物
restoreDrag:false,//恢复位置
areaExchange:false,//区域交换
oneKeyReset:false,//一键恢复
};
}else{//上课前且上课前不发布音视频,则不显示按钮
return actionButtonArray ;
}
}else{
if (TkConstant.hasRole.roleStudent) {
loadActionBtn = {
scrawl:false ,//画笔
platform:false,//上下台
audio:closeMyseftAV && isMyself,//音频
video:closeMyseftAV && isMyself,//视频
gift:false,//送礼物
restoreDrag:CoreController.handler.getAppPermissions('isCanDragVideo')&&this.props.direction === 'horizontal',//恢复位置
areaExchange:false,//区域交换
oneKeyReset:false,//一键恢复
};
}else if (TkConstant.hasRole.roleChairman) {
loadActionBtn = {
scrawl:!isMyself,
platform:!isMyself,
audio:true,
video:isMyself?true:true,
/*video:TkConstant.testTemplate==='template_newblack'?(isMyself?true:true):isMyself,*/
gift:!isMyself,
restoreDrag:CoreController.handler.getAppPermissions('isCanDragVideo')&&this.props.direction === 'horizontal',
areaExchange:false,
oneKeyReset:isMyself,
};
}else if (TkConstant.hasRole.roleTeachingAssistant) {
loadActionBtn = {
scrawl:isMyself?false:user.role !== TkConstant.role.roleChairman ,
platform:isMyself?false:user.role !== TkConstant.role.roleChairman,
audio:isMyself?true:(user.role !== TkConstant.role.roleChairman),
video:isMyself?true:true,
/*video:TkConstant.testTemplate==='template_newblack'?(isMyself?true:true):isMyself,*/
gift:false,
restoreDrag:CoreController.handler.getAppPermissions('isCanDragVideo')&&this.props.direction === 'horizontal',
areaExchange:false,
oneKeyReset:false,
};
}else if (TkConstant.hasRole.rolePatrol) {
loadActionBtn = {
scrawl:false ,
platform:false,
audio:false,
video:false,
gift:false,
restoreDrag:false,
areaExchange:false,
oneKeyReset:false,
};
}
}
let actionBtnJson = {
scrawl: {
disabled: false,
languageKeyText: (user.candraw ? 'no' : 'yes'),
className: 'scrawl-btn ' + ( (user.candraw )? 'no' : 'yes'),
onClick: this.changeUserCandraw.bind(this, user.id),
title: user.candraw ? TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.Scrawl.on.title : TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.Scrawl.off.title,
isShow: !this.props.isSplitScreenFromStream && ( isMyself ? false : (user.role === TkConstant.role.roleStudent) ), //不是学生(并且不处于分屏下)则隐藏
},
platform: {
disabled: false,
languageKeyText: (user.publishstate !== TkConstant.PUBLISHSTATE.PUBLISH_STATE_NONE ? 'no' : 'yes'),
className: 'platform-btn '+ (user.publishstate !== TkConstant.PUBLISHSTATE.PUBLISH_STATE_NONE ? 'no' : 'yes'),
onClick: this.userPlatformUpOrDown.bind(this, user.id),
title: user.publishstate !== TkConstant.PUBLISHSTATE.PUBLISH_STATE_NONE ? TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.update.up.title : TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.update.down.title,
isShow: isMyself ? false : (user.role === TkConstant.role.roleStudent || user.role === TkConstant.role.roleTeachingAssistant )? true : !this.props.isDrag,//tkpc2.0.8
},
audio: {
disabled: false,
languageKeyText: (user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_AUDIOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH) ? 'no' : 'yes',
className: 'audio-btn ' + ( (user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_AUDIOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH) ? 'no' : 'yes'),
onClick: this.userAudioOpenOrClose.bind(this, user.id),
title: user.disableaudio ? TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.audio.disabled.title : (
user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_AUDIOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH ?
TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.audio.on.title : TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.audio.off.title
),
isShow: user.hasaudio ,
},
video: {
disabled: false,
languageKeyText: (user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_VIDEOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH) ? 'no' : 'yes',
className: 'video-btn ' + ( (user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_VIDEOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH) ?'no' : 'yes' ),
onClick: this.userVideoOpenOrClose.bind(this, user.id),
title: user.disablevideo ? TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.video.disabled.title : (
user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_VIDEOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH ?
TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.video.on.title : TkGlobal.language.languageData.toolContainer.toolIcon.userList.button.video.off.title
),
isShow:TkGlobal.isSplitScreen?false:user.hasvideo,//tkpc2.0.8
/*isShow:TkConstant.testTemplate==='template_newblack'?user.hasvideo:(isMyself ? user.hasvideo : false)*/
},
gift: {
disabled: false,
languageKeyText: 'yes',
className: 'gift-btn',
onClick: this.sendGiftToStudent.bind(this, user.id),
title: TkGlobal.language.languageData.otherVideoContainer.button.gift.yes,
isShow: isMyself ? false : (user.role === TkConstant.role.roleStudent && TkConstant.hasRole.roleChairman),
},
restoreDrag: {
disabled: false,
languageKeyText: 'text',
className: 'restoreDrag-btn',
onClick: this.restoreVideoDrag.bind(this, user.id),
title: TkGlobal.language.languageData.otherVideoContainer.button.restoreDrag.text,
isShow: (TkGlobal.isSplitScreen ? false : this.props.isDrag ),//tkpc2.0.8
},
areaExchange: {
disabled: false,
languageKeyText: 'text',
className: 'areaExchange-btn',
onClick: this.handlerAreaExchange.bind(this),
title: undefined,
isShow: false, //todo 区域交换先取消
},
oneKeyReset:{
disabled: false,
languageKeyText: 'text',
className: 'oneKeyReset-btn',
onClick: this.handlerOneKeyReset.bind(this),
title: undefined,
isShow: TkConstant.hasRole.roleChairman && isMyself && !TkConstant.isBaseboard && !TkConstant.hasRoomtype.oneToOne ,
}
};
for( let key of Object.keys(actionBtnJson) ){
if(loadActionBtn[key]){
actionButtonDesc.push(actionBtnJson[key]);
}
}
actionButtonDesc.map( (item , index) => {
let { disabled , languageKeyText , className , onClick , title , isShow } = it em ;
if(isShow){
let buttonName = className.split("-");
actionButtonArray.push(
<button key={index}
className={'' + (className || '') + ' ' + (disabled ? ' disabled ' : ' ')}
onClick={onClick && typeof onClick === "function" ? onClick : undefined}
disabled={disabled ? disabled : undefined}
style={{display:!isShow?'none':'block'}} title={TkGlobal.language.languageData.otherVideoContainer.button[buttonName[0]][languageKeyText]?TkGlobal.language.languageData.otherVideoContainer.button[buttonName[0]][languageKeyText]:this.props.direction === 'horizontal'?TkGlobal.language.languageData.otherVideoContainer.button[buttonName[0]][languageKeyText]:undefined} >
{TkConstant.testTemplate === 'template_newblack'?null:this.props.direction === 'horizontal'?undefined:TkGlobal.language.languageData.otherVideoContainer.button[buttonName[0]][languageKeyText]}
</button>
);
}
} );
return actionButtonArray ;
}
_percentageChangeToRem(percentLeft,percentTop,videoWidth,videoHeight) {
let videoLeft = 0;
let videoTop = 0;
if(this.props.direction === 'horizontal'){
let defalutFontSize = window.GLOBAL.windowInnerWidth / TkConstant.STANDARDSIZE ;
//获取白板区域宽高:
let boundsEle = document.getElementById('lc-full-vessel');
let boundsEleW = boundsEle.clientWidth;
let boundsEleH = boundsEle.clientHeight;
//计算白板区工具相对白板的位置:
videoLeft = percentLeft*(boundsEleW - videoWidth*defalutFontSize)/defalutFontSize;
videoTop = percentTop*(boundsEleH - videoHeight*defalutFontSize)/defalutFontSize;
}
return {videoLeft,videoTop};
}
render() {
let {connectDropTarget, connectDragSource, connectDragPreview, getItem, isDragging, percentLeft, percentTop, id, isDrag, isCanDrag,videoWidth,videoHeight, videoOnDoubleClick } = this.props;
this.layerIsShowOfIsDraging(isDragging, TkGlobal.isVideoStretch, getItem);
let {user={}} = this._loadStreamInfo(this.props.stream);
let userInfoIconArray = [] ;
let actionButtonArray = [] ;
if( user && Object.keys(user).length > 0 ){
userInfoIconArray = this._loadUserInfoIconArray(user);
actionButtonArray = this._loadActionButtonArray(user);
}
let dragIsHide = this.props.hasDragJurisdiction ? !isCanDrag :false ;
let thisVideoDragStyle = undefined ;
let videoNum = TkConstant.template === 'template_sharktop'?7:6;
if(this.props.direction === 'horizontal'){
let {videoLeft,videoTop} = this._percentageChangeToRem(percentLeft,percentTop,videoWidth,videoHeight);
if(TkGlobal.isSplitScreen || this.props.isDrag ){
if(!this.maxWidthToActionContainer){
this.maxWidthToActionContainer = videoWidth+'rem' ;
}
}else{
this.maxWidthToActionContainer = undefined ;
}
thisVideoDragStyle = {
cursor: isCanDrag?"move":"default",
top: videoTop+ TkGlobal.dragRange.top+'rem',
left: videoLeft + TkGlobal.dragRange.left+'rem',
margin:isDrag?0:undefined,
position: isDrag ? 'fixed' : '',
width: isDrag?videoWidth+'rem':'calc(100% / '+(videoNum)+' - 0.1rem )',
height:isDrag?videoHeight+'rem':undefined,
zIndex: TkConstant.template === 'template_sharktop' ? (isDrag ?300:undefined) : (!isDrag?400:399) ,
};
}
return connectDropTarget(connectDragSource(
<li id={id || user.id} onMouseMove={this.mouseMove.bind(this)} onMouseDown={this.mouseDown.bind(this)} className={"video-permission-container clear-float " + (this.props.videoDumbClassName+'-option-container ')+ (this.props.className || ' ') + ' ' +(this.props.pictureInPictureClassname || ' ')} onDoubleClick={videoOnDoubleClick} style={ this.props.videoContainerStyle || thisVideoDragStyle} >
<div className={Object.keys(user).length>0?user.hasvideo?"video-wrap video-participant-wrap video-other-wrap add-position-relative":"video-wrap video-participant-wrap video-other-wrap add-position-relative videoerr":'video-wrap video-participant-wrap video-other-wrap add-position-relative user'} id={user.id?'videoContainer_'+user.id:undefined} >
{this.props.stream?<VideoDumb volume={ServiceRoom.getTkRoom()?ServiceRoom.getTkRoom().getMySelf().volume:100} stream={this.props.stream} videoDumbClassName={this.props.videoDumbClassName} /> : undefined }
<div className="v-name-wrap clear-float other-name " >
<span className="v-name add-nowrap add-fl" >{user.nickname}</span>
{(user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_AUDIOONLY || user.publishstate === TkConstant.PUBLISHSTATE.PUBLISH_STATE_BOTH)&&user.hasaudio?<div className='Audiochangew'><div className='Audiochangewlogo'></div>{this.props.stream ?<Audiochange user={user} stream={this.props.stream}/>:null}</div>:null}
<span className="v-device-open-close add-fr clear-float" >
{userInfoIconArray}
</span>
</div>
<div className="user-network-delay" style={{color:this.state.networkDelayColor,display:(TkGlobal.classBegin && this.props.stream !== undefined && this.state.hasNetworkState)?"none":"none"}}> {/*todo 暂时不显示网络状态:inline-block*/}
<span className="user-network-dot" style={{backgroundColor:this.state.networkDelayColor}} />
<span className="user-network-delay-num">{this.state.networkDelay+'ms'}</span>
</div>
<div className="gift-show-container " style={{display:this.props.stream && user.role === TkConstant.role.roleStudent?undefined:'none'}}>
<span className="gift-icon" />
<span className="gift-num">{user.giftnumber || 0}</span>
</div>
<div className="video-hover-function-container" style={{display:dragIsHide?"none":(actionButtonArray.length===0?'none':undefined) , maxWidth:this.maxWidthToActionContainer}}>
<span className="button-set role-student" onDoubleClick={ (e) => { e.stopPropagation(); return false ; } } >
{actionButtonArray}
</span>
</div>
<div className="background-mode-float" style={{display:(TkGlobal.classBegin || TkConstant.joinRoomInfo.isBeforeClassReleaseVideo) && user.isInBackGround ?"block":"none"}}>
<p className="background-mode-prompt">{user.role===TkConstant.role.roleChairman?TkGlobal.language.languageData.otherVideoContainer.prompt.userText:TkGlobal.language.languageData.otherVideoContainer.prompt.text}</p>
</div>
<div className="video-participant-raise-btn add-position-absolute-top0-right0" style={{display: user.raisehand?'block':'none'}}>
<span className="raise-img" />
</div>
<div className="foregroundpic-container" style={{display:TkConstant.hasRole.roleStudent && TkConstant.joinRoomInfo.foregroundpic && this.props.foregroundpicUrl && this.props.pictureInPictureClassname ? 'block':'none' , backgroundImage:TkConstant.hasRole.roleStudent && TkConstant.joinRoomInfo.foregroundpic && this.props.foregroundpicUrl && this.props.pictureInPictureClassname?'url('+(this.props.foregroundpicUrl)+')':undefined }} />
</div>
</li>
))
};
};
const HVideoComponentDragSource = DragSource('talkDrag', specSource, collect)(CommonVideoSmart);
export default DropTarget('talkDrag', specTarget, connect => ({
connectDropTarget: connect.dropTarget(),
}))(HVideoComponentDragSource);