Avoiding playing files where codec is missing or format doesn't match extension
- From: noneya22@xxxxxxxxxx
- Date: Tue, 12 Aug 2008 14:54:46 -0700 (PDT)
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.
.
- Follow-Ups:
- Re: Avoiding playing files where codec is missing or format doesn't match extension
- From: Alessandro Angeli
- Re: Avoiding playing files where codec is missing or format doesn't match extension
- Prev by Date: Using Windows Portable Devices from c#
- Next by Date: Re: Avoiding playing files where codec is missing or format doesn't match extension
- Previous by thread: Using Windows Portable Devices from c#
- Next by thread: Re: Avoiding playing files where codec is missing or format doesn't match extension
- Index(es):
Relevant Pages
|