Skip to content

Commit

Permalink
Play/Pause on A/B button press
Browse files Browse the repository at this point in the history
  • Loading branch information
takafumi-ko committed Apr 28, 2022
1 parent 2768df5 commit 9abd388
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions layers-samples/media-layer-sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,25 @@
video.currentTime = 0;
video.play();
} else if (buttonPressedThisFrame(source.gamepad, 1)) {
if (video.paused)
if (video.paused) {
console.log("1:play")
video.play();
else
}
else {
console.log("1:pause")
video.pause();
}
}else if(buttonPressedThisFrame(source.gamepad, 4)){
if (video.paused) {
console.log("4:play");
video.play();
}
}
else if(buttonPressedThisFrame(source.gamepad, 5)){
if (!video.paused) {
console.log("5:pause")
video.pause();
}
}
}
}
Expand Down

0 comments on commit 9abd388

Please sign in to comment.