Skip to content

Commit 5d7ce8d

Browse files
committed
ask a text to request user interaction
1 parent cab4575 commit 5d7ce8d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

video/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@
6060
// Note: force change now since we are adding things straight away outside of a proper stage object
6161
me.state.change(me.state.DEFAULT, true);
6262

63+
64+
// user interaction is required to start the video
65+
// it does not need to clickable, video will start as soon as a click is detected by the browser
66+
let textMsg = new me.Text(
67+
me.game.viewport.width / 2,
68+
me.game.viewport.height / 2, {
69+
font: "Arial",
70+
size: 20,
71+
fillStyle: "white",
72+
textAlign: "center",
73+
text: "click here to start the video"
74+
});
75+
76+
// add the video sprite to the scene
77+
me.game.world.addChild(textMsg);
78+
6379
// create a new sprite instance
6480
var videoSprite = new me.Sprite(
6581
me.game.viewport.width / 2,

0 commit comments

Comments
 (0)