Movie in Panel Help :)

Posted By: Anonymous

Movie in Panel Help :) - 04/17/03 08:31

Hi, can some please help me?
I need to make AVI or any other movie file to play in the background of my Menu Panel instead of image.
(Im Workin g with 3DGS 5.51 Com Ed)

Thanks in advance! [Big Grin]
Posted By: giorgi3

Re: Movie in Panel Help :) - 04/17/03 10:19

Here is an example of displaying a movie in a small window on top of a panel.

code:
  
bmap moviescreen_bmp = <moviescreen.bmp>; // smaller window
bmap intromap = <intro.bmp>; // panel bitmap

panel introscreen {
bmap = intromap;
flags = refresh,d3d;
window 150,10,320,235,moviescreen_bmp,0,0; // position small window on panel to play the movie on
}

movie_handle = media_play ("movie.avi",moviescreen_bmp,150); // play the movie on the moviescreen window of the panel


while (media_playing(movie_handle) != 0)
{
// allow interruption of the video by hitting anykey
if (key_any != 0)
{
media_stop (movie_handle);
}
wait (1);
}

Hope this helps
Posted By: Anonymous

Re: Movie in Panel Help :) - 04/17/03 11:24

It Gives me an error "Can't Compile Script"
Posted By: giorgi3

Re: Movie in Panel Help :) - 04/17/03 12:05

Is that the only error message? Where did you place the code? Do you have bitmaps, movie defined with your stuff?
Posted By: Anonymous

Re: Movie in Panel Help :) - 04/17/03 15:14

yeah, i had everything bitmat names as its there and movie file
and it didnt work.
Posted By: Rhuarc

Re: Movie in Panel Help :) - 04/18/03 10:56

We chatted online and this is the working code for those interested [Wink] :
code:
 bmap moviescreen_bmp = <moviescreen.bmp>; // smaller window
bmap intromap = <intro.bmp>; // panel bitmap

panel introscreen {
bmap = intromap;
flags = refresh,d3d,visible;
window 150,10,320,235,moviescreen_bmp,0,0; // position small window on panel to play the movie on
}

var movie_handle;

function movie_ctrl()
{
while (media_playing(movie_handle) != 0)
{
// allow interruption of the video by hitting anykey
if (key_any != 0)
{
media_stop (movie_handle);
}
wait (1);
}
introscreen.visible = off;
}

then in your main function, at the end:
code:
 	movie_handle = media_play ("movie.avi",moviescreen_bmp,150);
movie_ctrl();

I think thats all of it...
Posted By: giorgi3

Re: Movie in Panel Help :) - 04/22/03 11:48

Hi [SF]Rhuarc,

Nicely done. I see I missed the var movie_handle statement in my original post. I also like the way you broke the interrupt code out into a function.

Giorgi3
© 2023 lite-C Forums