Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opening a video automatically from a directory
#1
Hi,

I have searched all over the web for some sort of simple code that would just open this video file. I have managed to create a media player but you have to choose the file yourself. Is there a simple way that would just load this single file when the form starts?
#2
Hello, K_Mccormic.

Yes, there is a very simple way to automatically load the specific file into the Windows Media Player made in VB10.

Steps:
1. Click on the Windows Media Player component on the design tab.
2. Go into the properties.
3. Find 'URL' field and type the path to the specific file. (An example is below)
4. Enjoy!


If you use Windows 7, you can copy and paste the text, below, into the URL field just to test how it works. Hehe!
Code:
C:\Users\Public\Videos\Sample Videos\Wildlife.wmv

Regards,
Vinwarez.
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#3
thanks for the quick reply. I got another question. when I tried to open the form with the media player, the program crashes and shows me the following error:

An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.#

I have no idea why it happened. it use to work <!-- s:? --><img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
#4
AtmaWeapon Wrote:Because VB .NET 2008 defaulted to AnyCPU and VS 2010 defaults to x86. Part of this is because of the troubles you're having, and I suspect part of it has to do with they didn't finish making Intellitrace work with x64 and it'd hurt their marketing to have a flagship feature not work out of the box.

There is no version of VS 2010 in which you can't change the platform, but it's harder in Express Edition. Here's how to do it:
  • Open solution explorer. (Ctrl+Alt+L by default.)
  • Right-click on your solution, not the project file. It's not visible by default in VB 2010 Express Edition, so if you can't see it:
    - Go to Tools>Options...
    - Click the "Projects and Solutions" item.
    - Check the "Always show Solution" box.
  • When you've right-clicked the solution, choose "Configuration Manager".

That window will list all of your projects and let you choose a platform. Make sure to change it for both release and debug builds.
Source: http://tinyurl.com/7gvr7h9
Also known as Rocketalypse.
System.out.println("I prefer Java.");


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I add a video player to my mainform??? mnxford 10 39,301 03-27-2013, 08:11 PM
Last Post: mnxford
  Open a directory brco900033 6 22,469 11-09-2011, 09:32 PM
Last Post: chuckebaby

Forum Jump:


Users browsing this thread: 1 Guest(s)