There is an event in the TMediaPlayer that is a better place to turn it off. I 
think your mediaplayer is running into the situation where it wants to play 
something but nothing is assigned to it. 

Dave

--- On Fri, 7/4/08, Anu Rang <[EMAIL PROTECTED]> wrote:
From: Anu Rang <[EMAIL PROTECTED]>
Subject: [delphi-en] Re: A TMediaPlayer Question – Error ‘No MCI device 
open’
To: [email protected]
Date: Friday, July 4, 2008, 2:28 PM










    
            My application has two timers. The TMediaPlayer is turned off 
ontimer 

event. Here is the snipet of source code



procedure TForm1.Button1Click (Sender : TObject);

begin

  ...;

  ...;

  Form1.GetItemData( itemnumber) ;

end;



procedure TForm1.GetItemData( itemnumber : string);

begin

 ...;

 ...;

  if mediaplayer_ ON then

   begin

    Form1.MediaPlayer1. Stop;

    Form1.MediaPlayer1. Close;

    mediaplayer_ ON := false;

   end;



mediaplayer_ ON := true;

  Form1.PlayMP3Music;

end;



procedure TForm1.Timer2Timer( Sender : TObject);

begin

  ...;

  ...;

  ...;

  if mediaplayer_ ON then

   begin

    Form1.MediaPlayer1. Stop;

    Form1.MediaPlayer1. Close;

    mediaplayer_ ON := false;

   end;

end;



The PlayMP3Music is not within a thread object. Initially i didnt 

think it necessary to have it threaded. But now I wonder if that 

might fix it. I may try that in a few days time.

Hope that helps explain the case.



Anu Rang, TotallyFreeEnergy

http://totallyfreee nergy.zxq. net



--- In [EMAIL PROTECTED] ps.com, David Smith <djsmith_1998@ ...> 

wrote:

>

> Your app requires all those other things installed before it will 

run and it still doesn't run?

> 

> Â  Maybe it's trying to repeat play? Are you explicitly turning it 

off after it plays once? 

> 

> Dave

> 

> --- On Fri, 7/4/08, Anu Rang <totallyfreeenergy@ ...> wrote:

> From: Anu Rang <totallyfreeenergy@ ...>

> Subject: [delphi-en] A TMediaPlayer Question â€" Error ‘No MCI 

device open’

> To: [EMAIL PROTECTED] ps.com

> Date: Friday, July 4, 2008, 12:25 PM

> 

> 

> 

> 

> 

> 

> 

> 

> 

> 

>     

>             My Delphi7 application which uses TMediaPlayer to play 

resourcestream 

> 

> from a MP3 file compiles and executes OK. The install of it on my 

PC 

> 

> (Windows XP SP2) is also OK. But when I install and try to run the 

> 

> application on another Windows XP SP2 PC I get the infinite loop 

error 

> 

> message `No MCI device open' after the TmediaPlayer had been 

activated 

> 

> and the music played once.

> 

> 

> 

> A search of the internet yielded many such reports on many forums. 

But 

> 

> no solutions that worked for me.

> 

> 

> 

> The application download is at

> 

> http://totallyfreee nergy.zxq. net/Freewares. htm and

> 

> http://totallyfreee nergy.freehoxt. com/Freewares. htm 

> 

> 

> 

> I wonder if anyone here on this forum has had any similar 

experience. 

> 

> Thanks-in-advance for any input..

> 

> 

> 

> Anu Rang, TotallyFreeEnergy

> 

> http://totallyfreee nergy.zxq. net

> 

> 

> 

> 

>       

> 

>     

>     

>       

>        

>       

>       

> 

> 

> 

> 

> 

> 

> 

> 

>       

> 

> 

>       

>       

> 

> 

>       

> 

> [Non-text portions of this message have been removed]

>




      

    
    
        
         
        
        








        


        
        


      

[Non-text portions of this message have been removed]

Reply via email to