GilbertClaus commited on
Commit
165859f
·
1 Parent(s): 8fb6476

Auto Full Screen

Browse files
Files changed (1) hide show
  1. ArkReCode/script.js +12 -1
ArkReCode/script.js CHANGED
@@ -9,9 +9,20 @@ function playVideo(charName) {
9
  video.width = 360;
10
  video.controls = true;
11
  video.autoplay = true;
12
- video.volume = 0.05;
13
  video.style.marginTop = "20px";
14
  wrapper.appendChild(video);
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
 
17
  function fetchData() {
 
9
  video.width = 360;
10
  video.controls = true;
11
  video.autoplay = true;
12
+ video.volume = 0.01;
13
  video.style.marginTop = "20px";
14
  wrapper.appendChild(video);
15
+
16
+ // Minta fullscreen setelah video ditambahkan ke halaman
17
+ video.addEventListener("loadedmetadata", () => {
18
+ if (video.requestFullscreen) {
19
+ video.requestFullscreen();
20
+ } else if (video.webkitRequestFullscreen) { // Safari
21
+ video.webkitRequestFullscreen();
22
+ } else if (video.msRequestFullscreen) { // IE11
23
+ video.msRequestFullscreen();
24
+ }
25
+ });
26
  }
27
 
28
  function fetchData() {