Thread View: borland.public.cppbuilder.multimedia
4 messages
4 total messages
Started by Rafael
Thu, 27 Mar 2003 16:25
Media Player closes video image in the end
Author: Rafael
Date: Thu, 27 Mar 2003 16:25
Date: Thu, 27 Mar 2003 16:25
46 lines
1974 bytes
1974 bytes
Hello all:
I'm having a problem with TMediaPlayer component in BCB4 that is annoying
me.
I place one component on a Form, assign it to a Panel and control it in
the code. My intention is to play one AVI, wait for it to finish, then do
something else and later play another AVI that continues the same scene
than the first one.
The problem is that when the first AVI ends, the panel turns into grey,
not showing the last AVI frame.
If I just use this code:
MediaPlayer->FileName="myavi.avi";
MediaPlayer->Open();
MediaPlayer->Play();
MediaPlayer->Play();
the AVI works and ends well, but so I can't control when it finishes. If
I use any of these techniques:
MediaPlayer->FileName="myavi.avi";
MediaPlayer->Open();
MediaPlayer->Play();
MediaPlayer->Play();
do {
Sleep(1000);
} while(MediaPlayer->Mode!=1);
or
MediaPlayer->FileName="myavi.avi";
MediaPlayer->Open();
MediaPlayer->Play();
MediaPlayer->Wait=true;
MediaPlayer->Play();
then the panel greys out.
Any idea?
Can anyone suggest a better AVI component than the one in BCB4?
Thank you very much and best regards.
Rafael Caballos
Re: Media Player closes video image in the end
Author: Andrew Warren
Date: Fri, 28 Mar 2003 12:37
Date: Fri, 28 Mar 2003 12:37
5 lines
937 bytes
937 bytes
Hi, Try TActiveMovie (http://www.datastead.com) Andy.
Re: Media Player closes video image in the end
Author: Marcelo R. Lopez, Jr.
Date: Tue, 15 Apr 2003 16:20
Date: Tue, 15 Apr 2003 16:20
68 lines
3250 bytes
3250 bytes
Rafael,
The short answer is "You can't do that". The long answer is that you can't
switch media elements with the device open.
Playing individual files are a Open(), Play(), Close(), sort of deal with
TMediaPlayer. To do what you're saying, you would have to
Pause() the MediaPlayer at that last moment ( and you can do this by setting
yourself up to be notified by the MCI as the playback progresses ), and then
do the stop of the video ( so that it's still displaying that last frame ).
Then, when you're ready to play the next element....and I'm still not
certain this will work for you, you're going to have to close(), assign the
new video file clip, Open() and Play(), one right after the other.
TMediaPlayer does NOT support playing from memory, so that rules out being
able to switch streams on it.
Marcelo R. Lopez, Jr.
"Rafael" <rafcab@hotpop.com> wrote in message
news:Xns934BB1C644D4Arafcabhotpopcom@207.105.83.65...
> Hello all:
>
> I'm having a problem with TMediaPlayer component in BCB4 that is annoying
> me.
>
> I place one component on a Form, assign it to a Panel and control it in
> the code. My intention is to play one AVI, wait for it to finish, then do
> something else and later play another AVI that continues the same scene
> than the first one.
> The problem is that when the first AVI ends, the panel turns into grey,
> not showing the last AVI frame.
> If I just use this code:
>
> MediaPlayer->FileName="myavi.avi";
> MediaPlayer->Open();
> MediaPlayer->Play();
> MediaPlayer->Play();
>
>
> the AVI works and ends well, but so I can't control when it finishes. If
> I use any of these techniques:
>
> MediaPlayer->FileName="myavi.avi";
> MediaPlayer->Open();
> MediaPlayer->Play();
> MediaPlayer->Play();
> do {
> Sleep(1000);
> } while(MediaPlayer->Mode!=1);
>
> or
>
> MediaPlayer->FileName="myavi.avi";
> MediaPlayer->Open();
> MediaPlayer->Play();
> MediaPlayer->Wait=true;
> MediaPlayer->Play();
>
> then the panel greys out.
>
> Any idea?
> Can anyone suggest a better AVI component than the one in BCB4?
>
> Thank you very much and best regards.
>
> Rafael Caballos
Re: Media Player closes video image in the end
Author: Rafael
Date: Thu, 17 Apr 2003 10:58
Date: Thu, 17 Apr 2003 10:58
36 lines
2332 bytes
2332 bytes
Hi Marcelo: Thank you for your answer, though you don't give me much hope. I've tried to close, stop and pause the video but the final effect is the same: grey screen. What I've done is place a TImage component over TMediaPlayer and toggle it on or off when I need. It is not a good solution but I can't find another way to solve it. If you come across other possible solutions, please let me know. Regards Rafael Caballos "Marcelo R. Lopez, Jr." <marcelol@directvinternet.com> wrote in news:3e9c2fc3$1@newsgroups.borland.com: > Rafael, > > The short answer is "You can't do that". The long answer is that you > can't switch media elements with the device open. > Playing individual files are a Open(), Play(), Close(), sort of deal > with TMediaPlayer. To do what you're saying, you would have to > Pause() the MediaPlayer at that last moment ( and you can do this by > setting yourself up to be notified by the MCI as the playback > progresses ), and then do the stop of the video ( so that it's still > displaying that last frame ). Then, when you're ready to play the next > element....and I'm still not certain this will work for you, you're > going to have to close(), assign the new video file clip, Open() and > Play(), one right after the other. > > TMediaPlayer does NOT support playing from memory, so that rules out > being able to switch streams on it. > > Marcelo R. Lopez, Jr. >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads