Is it possible to determine that the video is complete?

Posted By: gamers

Is it possible to determine that the video is complete? - 08/11/21 15:07

Hello there,

I'm trying to understand whether the video is complete with the code I shared below, but it doesn't work as I want. I could not determine where I made a mistake. Please could you help me?

The code:



Code
if(media_playing(EoL_video)==1) 
	{
		reset(EoL_video_panel,SHOW);
		wait (1);
	
	}
	else
	{
		set(EoL_video_panel,SHOW);
	}
Posted By: 3run

Re: Is it possible to determine that the video is complete? - 08/15/21 17:31

Hey! Use handles and 'media_playing' for that.
Something like this:
Code
void play_media()
{
	var handle = media_play(...)
	while(media_playing(handle))
	{
		wait(1);
	}
}
Posted By: gamers

Re: Is it possible to determine that the video is complete? - 08/16/21 11:39

Hi 3run,
Thank you very much!

Best regards,

Originally Posted by 3run
Hey! Use handles and 'media_playing' for that.
Something like this:
Code
void play_media()
{
	var handle = media_play(...)
	while(media_playing(handle))
	{
		wait(1);
	}
}
Posted By: rayp

Re: Is it possible to determine that the video is complete? - 08/25/21 21:21

good media-command-example (except of media_playing^^):
https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=52675&Number=439158#Post439158

edit: Btw...running video-handles might crash engine on level_load. Not 100% sure about this, but i always stop all running media handles before switching levels.
While thinking about, iam pretty sure this was caused by a video i rendered to texture of a entity, then switched the level, crash.

greets
© 2024 lite-C Forums