Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TMediaPlayer

Status
Not open for further replies.

rtb1

IS-IT--Management
Jul 17, 2000
73
ES
Hi,

I am trying to load a file from the Internet into a TMediaplayer on the main form. The problem is that the program hangs till downloading is finished. How can you put this process (closing a TMediaPlayer, changing the filename, opening the TMediaplayer and loading the file) into a thread to prevent the program from hanging?

Thanks,
Raoul
 
Raoul,

Have you tried setting the TMediaPlayer's Wait property to FALSE? For more information, see the Help Topic for that property; there are some design considerations to take into account.

Hope this helps...

-- Lance
 
Thanks Lance, I was about to try that but...

Actually, now I can't load a file from the Internet at all:

"MMSYSTEM264: There is not enough memory available for this task. Quit one or more programs then try again"

No problems when loading a file locally. I wonder what is going wrong now because it did download before?

According to microsoft this issue can occur if your Windows multimedia drivers are missing or damaged.

But I do not have this issue when loading from the Internet directly into the standard windows mediaplayer.












 
I have never used TMediaPlayer, but I believe it is not the Windows Player. So what apply for one don't apply for the other. (May be I'm wrong here).

The Win Player works great and is very flexible, you can import the ActiveX control in Delphi to use it BUT BUT BUT you can't drop the control in a form (it will make Delphi to hang while the program runs under the IDE), you need to instantiate it "by hand", what is very cumbersome (lots of properties and events to initialize programatically).

If both are the same, try instantiating it "by hand".

HTH.
buho (A).
 
rtb1,

I've not used TMediaPlayer to load a file from the net, so I don't have any direct experience with any problems.

However, you might see if the problem lies in obtaining the file or in playing it. To do that, try separating the process into two tasks, e.g. download the file into %TEMP% and then play it after it's fully saved.

Alternatively, you might launch Windows Media Player and try playing the file interactively. That may help determine whether the problem lies in your net connection or your sound settings.

Hope this helps...

-- Lance
 
Thanks Buho and Lance,

Don't understand what went wrong yesterday. I didn't change anything, but the problem of yesterday is gone.

It seems that setting the TMediaPlayer's Wait property to false doesn't work, program is still hanging during download.

Raoul



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top