0

I have been studying vb.net for a couple of months now and I want to try something new. I have this sample project to try. It is a web browser and I want that if a button will be clicked, a video will play immediately.

This is what my application looks like currently when I run the program:

web browser application sample run

Is it possible to store an mp4 file in my Visual Studio project so I can play the video in my app without streaming or opening a local file?

ico file stored in visual studio

See the above picture. The .ico file is stored in my project, so when the icon is used, it appears automatically since it is saved in the application. I wanted the same thing for my mp4 file. How to do it? Or where should it be saved? Is it even possible or probable?

I have searched a lot and I got these: stackoverflow question and microsoft tutorial. But none of these gives the answer of my question.

Community
  • 1
  • 1
MAC
  • 676
  • 3
  • 13
  • 32
  • 1
    _"I have searched a lot"_ - according to your links, you have searched way too narrowly. This isn't related to video or MP4 at all. The broader term you're looking for is "embedding a resource". I'm sure you can find something for that. See for example [Unraveling the confusion about Embedded Resources](http://stackoverflow.com/questions/8851991/unraveling-the-confusion-about-embedded-resources). – CodeCaster Jun 15 '15 at 10:39
  • @CodeCaster thanks for that term. I'm gonna go through it. :) – MAC Jun 15 '15 at 10:42
  • Please explain what you mean by "supported by Visual Studio". You can add any file type you want as resource. – CodeCaster Jun 16 '15 at 10:36

1 Answers1

1

Try going

Project>"Project Name" Properties>Resources>Add Resource>Add Existing File

This should add the file into your resources folder.

You can then access any file by going My.Resources.Name_Of_Resource

Sastreen
  • 597
  • 4
  • 13
  • Sastreen has helped you with the how to embed a file part of your question. The implicit part where you asks how to play an .mp4 file in dotnet is offtopic on SO because you'll need an API for that. – Mystra007 Jun 16 '15 at 02:55
  • 1
    @MAC If you mean that adding the file doesn't support mp4, I think you just have to select "All Files" for the filter. But if you mean that you don't know how to play mp4, I don't know either, but there are ways online (see http://www.mitov.com/tutorials/4 for instance) – Sastreen Jun 16 '15 at 10:21