Avoiding playing files where codec is missing or format doesn't match extension



We're using the WMP 11 ActiveX control in a .net forms application,
and a dialog is presented when we attempt to play a corrupt file. The
dialog states, for example, "The file you are attempting to play has
an extension (.wmv) that does not match the file format..."

We have created the corrupt file on purpose for testing purposes, but
I assume we might get a similar dialog if we're missing a codec for
the file. In any case, I would like to know if there is a way we can
either be notified via an event, or discover proactively via a method
call or implementation of an interface, that the file we are playing
is "suspect" before actually attempting to play the file or at least
before this dialog is displayed. Suspect meaning the file format
doesn't match the file extension or WMP doesn't have the correct
codec.

Our application plays a sequence of media files (.wmv, .asx & .wsx)
and if one of them is suspect/corrupt, then I want to simply detect
this condition and skip the file. There are registry entries that get
created if you respond to the dialog and check the "Don't ask me again
for this extension" checkbox. This does keep the dialog from being
displayed again, but doesn't help our ultimate problem of knowing to
go ahead and move onto the next media file. We're relying on the
PlayStateChanged event handler to know when we're done playing a
particular file. Specifically we're looking for wmppsStopped or
wmppsMediaEnded states to know we're done. In the problem scenario I
am describing, we don't get any events that would tell us the file is
done because it never really starts to play.
.



Relevant Pages

  • Re: Encountering 800700D error
    ... trying to play is corrupt. ... In the case of a corrupt file you would want to ... Get Instant WMP Answers ... > I have tried to download WMP at least 3 times. ...
    (microsoft.public.windowsmedia.player)
  • Re: ERROR MESSAGE 8007000D
    ... supported in WMP. ... trying to play is corrupt. ... In the case of a corrupt file you would want to ... > THE ABOVE ERROR MESSAGE CAME UP - HELP ...
    (microsoft.public.windowsmedia.player)
  • Re: purevolume
    ... fix this error so that i can still play the music on my computer. ... >> That indicates a corrupt file. ... >> end of the file" and won't download the song. ...
    (microsoft.public.windowsmedia.player)
  • Re: error msg 8007000D
    ... >> Windows Media Player. ... >> trying to play is corrupt. ... In the case of a corrupt file you would want ... >> Get Instant WMP Answers ...
    (microsoft.public.windowsmedia.player)
  • Re: Windows Media Player Error Message (is there no end to this? ;p)
    ... supported in WMP. ... trying to play is corrupt. ... In the case of a corrupt file you would want to ... > Windows Media Player Error Message Help ...
    (microsoft.public.windowsmedia.player)