Article View: borland.public.cppbuilder.multimedia
Article #681Re: Media Player closes video image in the end
From: 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
Technical Details
Message-ID:
<3e9c2fc3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<Xns934BB1C644D4Arafcabhotpopcom@207.105.83.65>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,b9417c11f5796e2e X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2003-04-15 09:19:15 PST Reply-To: "Marcelo R. Lopez, Jr." <marcelol@directvinternet.com> From: "Marcelo R. Lopez, Jr." <marcelol@directvinternet.com> Newsgroups: borland.public.cppbuilder.multimedia References: <Xns934BB1C644D4Arafcabhotpopcom@207.105.83.65> Subject: Re: Media Player closes video image in the end Date: Tue, 15 Apr 2003 12:20:04 -0400 Lines: 70 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 64.221.40.13 Message-ID: <3e9c2fc3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1050423235 64.221.40.13 (15 Apr 2003 09:13:55 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail