PhaserEditor2D-v3 icon indicating copy to clipboard operation
PhaserEditor2D-v3 copied to clipboard

Feature: Video support

Open zombiestruck opened this issue 1 year ago • 7 comments

It would be very handy to be able to add videos to a scene.

zombiestruck avatar Oct 20 '22 14:10 zombiestruck

Plus 1 :)

Edit: with the ability to also loadURL option would be really nice too.

ChildLearningClub avatar Oct 21 '22 20:10 ChildLearningClub

Also it may be nice to have a video queue with an option to loop the queue. I'm using the video on complete event to chain them.

zombiestruck avatar Oct 22 '22 04:10 zombiestruck

Hi @zombiestruck!

Also it may be nice to have a video queue with an option to loop the queue. I'm using the video on complete event to chain them.

Please can you explain this better? The "video queue" is something supported by Phaser?

PhaserEditor2D avatar Oct 22 '22 05:10 PhaserEditor2D

I think maybe just the “on video complete” signal is fired in Phaser 3 and @zombiestruck has another video play after and does that for a few videos. So in PhaserEditor2D to have on the right hand side after say a video “key” or url box there could be a plus button to add more that would then chain them together. Additionally there could be a “timer” timer wait time in seconds or play next video on action (like button press) before starting the next video asset or url linked video. Correct me if I’m wrong @zombiestruck ?

ChildLearningClub avatar Oct 22 '22 06:10 ChildLearningClub

It looks like something too specific. I think you can add the videos to an ObjectList and later execute them using a utility you did manually. Something like:

manager = new VideoManager(this.videoList)
manager.play()

PhaserEditor2D avatar Oct 22 '22 07:10 PhaserEditor2D

I thought maybe that was the case too.

ChildLearningClub avatar Oct 22 '22 08:10 ChildLearningClub

This was my quick and dirty solution. I was considering creating a system as you posted, but figured this would be good enough for now. I have a series of clips to play so a built-in queue would be nice.

attractVid1.on('complete', function(video){
			attractVid1.alpha = 0;
			attractVid2.alpha = 1;	
			attractVid2.play();
			attractVid1.setPaused(true);
			attractVid2.setPaused(false);
		}, this);
		
		attractVid2.on('complete', function(video){
			attractVid3.alpha = 1;
			attractVid2.alpha = 0;		
			attractVid3.play();
			attractVid2.setPaused(true);
			attractVid3.setPaused(false);
		}, this);
		
		attractVid3.on('complete', function(video){
			attractVid1.alpha = 1;
			attractVid3.alpha = 0;		
			attractVid1.play();
			attractVid3.setPaused(true);
			attractVid1.setPaused(false);
		}, this);

zombiestruck avatar Oct 22 '22 18:10 zombiestruck