1

I have a TMediaPlayer instance on a form in a Delphi VCL project (32 bit) (Delphi RAD Studio 10.1 Berlin). Working on Windows 10 Professional (64 bit).

I would like to assign the filename at runtime (since I can't predict that a user will have any particular file available). However, if I do not specify FileName in the media player's properties in the GUI interface, I get the error "Exception EMCIDeviceError in module xxx.exe at [address]. Cannot determine the device type from the given filename extension."

I am able to change the filename at runtime, but that might be too late if the user doesn't have the specified file.

Is there some setting that will instruct the media player to wait for a filename before looking for the one that is (or isn't) specified in the GUI?

Any help would be appreciated. Thank you!

  • Showing some code would probably help – Dave Nottage Mar 09 '18 at 12:49
  • The situation I have described arises just from using the settings in the 'Design' part of the IDE — without adding any extra code. – Bruce Button Mar 09 '18 at 13:03
  • Then describe exactly what properties you have set – Dave Nottage Mar 09 '18 at 13:17
  • 2
    The obvious answer is that you have set the AutoOpen property to TRUE and left the DeviceType as dtAutoSelect, but as Dave Nottage observes, unless you give us the information we can only guess. – Dsm Mar 09 '18 at 14:08
  • Sorry for the lack of information! But Dsm's answer pointed me to the solution. The problem was indeed with the AutoOpen and DeviceType properties. (It's the first time I'm using TMediaPlayer!) Thank you for the help. – Bruce Button Mar 09 '18 at 15:54

0 Answers0