Need help playing an AVI

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to embed an AVI then play it. I can right-click on my project,
add an existing item (the avi file), and have it show up in my solution
explorer. But how do I create an instance of it in order to pass it to the
axAnimation control (which wants a path and file name)? Any help would be
greatly appreciated. Thanks!
 
Shelby,

I don't think that you want to do this. The reason for this is that the
media player that you are going to embed in your project is most likely
COM-based, and doesn't know about the Stream class from .NET. This is
important, because this is how you would access your AVI from the resource.
In this case, I would actually ship the resource bundled with the app, and
have the player load it from disk.

Hope this helps.
 
Thanks for your response! Just so I understand, you're saying that I should
just make sure the stand-alone avi file is installed in the same location as
the application .exe and then find it using
"Path.GetDirectoryName(Application.ExecutablePath)". Correct?

Nicholas Paldino said:
Shelby,

I don't think that you want to do this. The reason for this is that the
media player that you are going to embed in your project is most likely
COM-based, and doesn't know about the Stream class from .NET. This is
important, because this is how you would access your AVI from the resource.
In this case, I would actually ship the resource bundled with the app, and
have the player load it from disk.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Shelby said:
I would like to embed an AVI then play it. I can right-click on my
project,
add an existing item (the avi file), and have it show up in my solution
explorer. But how do I create an instance of it in order to pass it to
the
axAnimation control (which wants a path and file name)? Any help would be
greatly appreciated. Thanks!
 
Shelby,

Without knowing what media player you are using, I would recommend that,
only because most media players should be able to load a file from disk.

If the media player is something that supports a byte stream from an
implementation of IStream in COM, then you could try and mimic this
(wrapping the Stream class), but that's up to you, as it might not be worth
the work.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Shelby said:
Thanks for your response! Just so I understand, you're saying that I
should
just make sure the stand-alone avi file is installed in the same location
as
the application .exe and then find it using
"Path.GetDirectoryName(Application.ExecutablePath)". Correct?

Nicholas Paldino said:
Shelby,

I don't think that you want to do this. The reason for this is that
the
media player that you are going to embed in your project is most likely
COM-based, and doesn't know about the Stream class from .NET. This is
important, because this is how you would access your AVI from the
resource.
In this case, I would actually ship the resource bundled with the app,
and
have the player load it from disk.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Shelby said:
I would like to embed an AVI then play it. I can right-click on my
project,
add an existing item (the avi file), and have it show up in my solution
explorer. But how do I create an instance of it in order to pass it to
the
axAnimation control (which wants a path and file name)? Any help would
be
greatly appreciated. Thanks!
 
Thanks for your help and the explanations. It's amazing how much I have yet
to learn!

Nicholas Paldino said:
Shelby,

Without knowing what media player you are using, I would recommend that,
only because most media players should be able to load a file from disk.

If the media player is something that supports a byte stream from an
implementation of IStream in COM, then you could try and mimic this
(wrapping the Stream class), but that's up to you, as it might not be worth
the work.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Shelby said:
Thanks for your response! Just so I understand, you're saying that I
should
just make sure the stand-alone avi file is installed in the same location
as
the application .exe and then find it using
"Path.GetDirectoryName(Application.ExecutablePath)". Correct?

Nicholas Paldino said:
Shelby,

I don't think that you want to do this. The reason for this is that
the
media player that you are going to embed in your project is most likely
COM-based, and doesn't know about the Stream class from .NET. This is
important, because this is how you would access your AVI from the
resource.
In this case, I would actually ship the resource bundled with the app,
and
have the player load it from disk.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I would like to embed an AVI then play it. I can right-click on my
project,
add an existing item (the avi file), and have it show up in my solution
explorer. But how do I create an instance of it in order to pass it to
the
axAnimation control (which wants a path and file name)? Any help would
be
greatly appreciated. Thanks!
 
Back
Top