Play Video as State intro/outro


#1

Hi,

I want to play a video as I start or shutdown a state. How would you do that? Especially the clicking event for the outro.
And: How would you play a video when starting the game?

It’s assumed that all videos should play sound, too.

The app is developed especially for mobile.


#2

I have a small WiP project that uses an online converter to convert a video to gif then play the images one by one https://github.com/nazimboudeffa/phaser-video


#3

Nice workaround. I’m afraid of increasing the app’s size by doing so, as gifs are not compressed as efficiently as videos, right?
However, it’s good enough to be accepted.


#4

Phaser play videos, any mp4 with H264 AAC encoding should be fine for many devices, but if your concern is about Chrome blocking auto play videos than it might need some extra walk arounds.


#5

That’s clear. I’m interested in those workarounds.


#6

@Cerlancism Am not sure that you can play videos with Phaser 2 CE, you intrigue me


#7

I’m not using CE (I guess) :smiley:


#8

Phaser CE can do it.

https://phaser.io/examples/v2/video/play-video
This is the example video format found in https://examples.phaser.io/assets/video/wormhole.mp4

Encoding
Video: MPEG4 Video (H264) 800x600 29.97fps 2506kbps [V: Mainconcept MP4 Video Media Handler [eng] (h264 main L3.1, yuv420p, 800x600, 2506 kb/s)]

Audio: AAC 48000Hz stereo 189kbps [A: Mainconcept MP4 Sound Media Handler [eng] (aac lc, 48000 Hz, stereo, 189 kb/s)]```

#9

Nice, I was stuck with an old version of phaser 2 before it added the video thank you for the info, I discover new features everyday
@Davaaron the video will probably be lesser in size then a set of images