play video

hey
i need to play my video 1 time and understend when it done.

i can not get it. i used is_playing and get_time …

PT(MovieTexture) texture_video = new MovieTexture(“AVI_texture”);
NodePath avi_plane_np;

avi_plane_np = window->load_model(framework.get_models(), “art/video/avi_plane.egg”);
avi_plane_np.reparent_to(window->get_render());

texture_video->read(“art/video/introductoin.avi”);

avi_plane_np.reparent_to(window->get_camera(0));
avi_plane_np.set_pos(0.22,1.8,1);
avi_plane_np.set_texture(texture_video, 0);

texture_video->play();
texture_video->set_loop(0);

    while(texture_video->get_time()  != texture_video->get_video_length())
     {
         framework.do_frame(current_thread);
     }
     
   // the video was wached

is_playing() should be able to do it. What are the results with the code that you have tried? Do you get any error messages?

Also, you have a typo in your filename, “introductoin” -> “introduction”.

while(texture_video->is_playing()) // it plays the video but it does not stop the loop in the end of the video

and i do not have any error messages

p.s. thanks for the typo :slight_smile: