* Extract WebChromeClient from an anonymous class * Support fullscreen videos on Android Forces landscape mode while playing. * Use sticky immersive mode for fullscreen videos No longer forces landscape mode as that is a problem for portrait videos - allow the user to rotate as necessary. Only supports KitKat or greater, and falls back to leaving the status and navigation bars visible for lower than KitKat. This is the easiest way to prevent issues with resizing the video during playback. Also implement a lifecyle event listener which means if a user backgrounds the app or locks the screen with the video fullscreen, the UI visibility is re-applied. * Add allowsFullscreenVideo prop to control whether videos can be fullscreen on Android Luckily, we're able to change the WebChromeClient on demand in response to prop changes without seeming to do any harm. If you switch to disallow fullscreen, it will attempt to close the currently fullscreened video (if there is one) so users aren't stuck. I did notice a bug that if you go from fullscreen allowed, to fullscreen disallowed, the fullscreen button will remain on the video. Tapping the button will have no effect.
|
|
||
6 |
|
6 |
|
7 |
|
7 |
|
8 |
|
8 |
|
|
9 |
|
|
9 |
|
10 |
|
10 |
|
11 |
|
11 |
|
12 |
|
|
13 |
|
|
12 |
|
14 |
|
|
15 |
|
|
13 |
|
16 |
|
|
17 |
|
|
14 |
|
18 |
|
|
19 |
|
|
15 |
|
20 |
|
16 |
|
21 |
|
17 |
|
22 |
|
|
|
||
24 |
|
29 |
|
25 |
|
30 |
|
26 |
|
31 |
|
|
32 |
|
|
27 |
|
33 |
|
28 |
|
34 |
|
29 |
|
35 |
|
|
|
||
106 |
|
112 |
|
107 |
|
113 |
|
108 |
|
114 |
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
109 |
|
118 |
|
110 |
|
119 |
|
111 |
|
120 |
|
|
|
||
137 |
|
146 |
|
138 |
|
147 |
|
139 |
|
148 |
|
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 |
|
|
|
|
149 |
|
|
193 |
|
150 |
|
194 |
|
151 |
|
195 |
|
152 |
|
|
|
||
454 |
|
411 |
|
455 |
|
412 |
|
456 |
|
413 |
|
|
414 |
|
|
|
415 |
|
|
|
416 |
|
|
|
417 |
|
|
|
418 |
|
|
|
419 |
|
|
|
420 |
|
|
|
421 |
|
|
457 |
|
422 |
|
458 |
|
423 |
|
459 |
|
424 |
|
|
|
||
554 |
|
519 |
|
555 |
|
520 |
|
556 |
|
521 |
|
557 |
|
|
|
|
522 |
|
|
558 |
|
523 |
|
559 |
|
524 |
|
560 |
|
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 |
|
|
561 |
|
583 |
|
562 |
|
584 |
|
563 |
|
585 |
|
|
|
||
655 |
|
677 |
|
656 |
|
678 |
|
657 |
|
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 |
|
|
658 |
|
773 |
|
659 |
|
774 |
|
660 |
|
775 |
|
|
|
||
30 |
|
30 |
|
31 |
|
31 |
|
32 |
|
32 |
|
|
33 |
|
|
33 |
|
34 |
|
34 |
|
35 |
|
35 |
|
36 |
|
|
|
||
591 |
|
592 |
|
592 |
|
593 |
|
593 |
|
594 |
|
|
595 |
|
|
|
596 |
|
|
|
597 |
|
|
|
598 |
|
|
|
599 |
|
|
|
600 |
|
|
|
601 |
|
|
|
602 |
|
|
|
603 |
|
|
|
604 |
|
|
594 |
|
605 |
|
595 |
|
606 |
|
596 |
|
607 |
|
|
|
||
48 |
|
48 |
|
49 |
|
49 |
|
50 |
|
50 |
|
|
51 |
|
|
51 |
|
52 |
|
52 |
|
53 |
|
53 |
|
54 |
|