Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MediaPlayer error when opening

326 views
Skip to first unread message

Dennis Palmer

unread,
Sep 23, 1999, 3:00:00 AM9/23/99
to
With the Delphi 4 MediaPlayer component I get an error when opening and
running .mpg files from a CD. One of our computers runs the files just
fine, but the other computer gives an error that the file cannot be
found and to please make sure the path and file name are correct. They
are correct!!!! I have check for the existance of the .mpg file with
the FileExists function before trying to open it with the MediaPlayer.
Using the ActiveMovie OCX component the program works just fine. It
seems like the MediaPlayer is not waiting long enough for the CD-ROM
drive to even be accessed before displaying the error. I would rather
not use the ActiveMovie component because as far as I can tell people
have to install Internet Explorer to get it. I need a solution that I
can include on the CD for distribution that won't require people to go
install something else before my app. will run.

Is there a re-distribuatable files list for ActiveMovie? Are there
legal restrictions involved in doing such a thing? Is there another
possible solution for playing .mpg files from Delphi?

Getting a fix for MediaPlayer would be the easiest thing if I cannot
place the ActiveMovie files into my installation.

Thanks,
Dennis


Jeff Overcash (TeamB)

unread,
Sep 24, 1999, 3:00:00 AM9/24/99
to
Here are some changes I suggested back in Sept '98. They fix another problem,
but I think that they also would deal with your problem also.

"It looks like the filename is mandatory under D4 when AutoOpen is set to
true. This is contrary to the way it worked under D3 and also contrary
to the documentation which states

"If AutoOpen is True, the media player attempts to open the multimedia
device specified by the DeviceType property (or FileName if DeviceType
is dtAutoSelect) when the form containing the media player component is
created at runtime. "

To fix this you need to add two lines to the MPlayer.pas file and
include your new file into the project.

line 820
OpenParm.lpstrElementName := PChar(FElementName);
change to
if FElementName <> '' then
OpenParm.lpstrElementName := PChar(FElementName);

and line 835
FFlags := FFlags or mci_Open_Element;
change to
if FElementName <> '' then
FFlags := FFlags or mci_Open_Element;

I would put the new MPlayer.pas in your project directory and add the
pas file to your project so it will use the changed one over the D4
packaged one."

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Mild mannered supermen are held in kryptonite, and the wise and foolish
virgins giggle with their bodies glowing bright. Through the door a harvest
feast is lit by candlelight; it's the bottom of the staircase that spirals out
of sight.
(new classic Genesis) Carpet Crawlers 1999
--

Dennis Palmer

unread,
Sep 24, 1999, 3:00:00 AM9/24/99
to
additional info:

I tried using the ActiveMovie component and everything worked fine. This component
has a ReadyState property that you can check while it is loading the file. You can't
try to play it until it is ready to go. Is there a similar mechanism with Media
Player? I need it to find the file and load it instead of imediately returning with
the cannot open file error.

Thanks,
Dennis


Dennis Palmer

unread,
Sep 24, 1999, 3:00:00 AM9/24/99
to
Jeff,

Changes made to mplayer.pas. Error unchanged.

Here's the code:

procedure TForm1.Button1Click(Sender: TObject);
begin
If OpenDialog1.Execute Then
Begin
MediaPlayer1.FileName := OpenDialog1.FileName;
MediaPlayer1.Open;
End;
end;

I know the file name is valid here. It works great if the .mpg file is on the
hard drive, but when the file is on a CD-ROM I get "MMSYSTEM275 Cannot find
specified file. Make sure the path & filename are correct." This is on a PII 400
with Win 98.

On another computer I get "MMSYSTEM277 a problem occurred initializing MCI. Try
restarting Windows." This is on a P133 Notebook running Windows 95. Does this
mean that this computer cannot play .mpg files? What needs to be added to the
computer for it to handle .mpg files? Is there a way to update the mmsystem.dll?

Thanks for your help,
Dennis

Bradford C. Miller

unread,
Sep 24, 1999, 3:00:00 AM9/24/99
to
So does this mean that you are going to use the active movie component
instead? If you do find an answer to your problem, please post it. I
have gotten the mmsystem errors as well, (though in a different
context), and have had little success in tracking down the causes.

In your case there are several properties that may have relevance. First
the Notify property will generate OnNotify events if it is set to true.
The NotifyValue property will then return the last notify events result.
This taken in conjunction with the Mode property should do what you
want. I would think that the Mode property will be mpNotReady while the
mpg is loading.

Jeff Overcash (TeamB)

unread,
Sep 24, 1999, 3:00:00 AM9/24/99
to

Dennis Palmer wrote:
>

> I know the file name is valid here. It works great if the .mpg file is on the
> hard drive, but when the file is on a CD-ROM I get "MMSYSTEM275 Cannot find
> specified file. Make sure the path & filename are correct." This is on a PII 400
> with Win 98.
>

If you have a small demo program of this e-mail me and I'll look at it.

> On another computer I get "MMSYSTEM277 a problem occurred initializing MCI. Try
> restarting Windows." This is on a P133 Notebook running Windows 95. Does this
> mean that this computer cannot play .mpg files? What needs to be added to the
> computer for it to handle .mpg files? Is there a way to update the mmsystem.dll?
>

Try updating the media player on this machine. That is probably the problem on
this one (it should at least be getting the same message as the first machine).
Also you might need to update to the latest comctl32.dll. you can find that at
http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp.

> Thanks for your help,
> Dennis
>

--

0 new messages