14 Replies - 553 Views - Last Post: 17 December 2012 - 11:10 AM
#1
want to know how could i embed video in software.
Posted 15 December 2012 - 11:40 PM
When i deployed my project and gave it to my friend.The video inside the software could not be played.so want to know how could i embed video in software. Its visual basic project.
Replies To: want to know how could i embed video in software.
#2
Re: want to know how could i embed video in software.
Posted 16 December 2012 - 02:17 AM
With only knowing zilch about who you set things up or called your video in code.. if it's added to the project click on it.. and set the compile property to 'embed'.
#3
Re: want to know how could i embed video in software.
Posted 16 December 2012 - 07:45 AM
I'm trying to create an application which plays a video on a form, everything works okay.
By the way i'm using axWindowsMediaPlayer component
The problem is, When I send this app to someone else, the video will not play.
Already expected this because of this line "axWindowsMediaPlayer1.URL = "C:\file-location-"
So I've put the video in my Resources and has set the property of Build=Embedded resources as you said but now i'm stuck even after doing this i am not able to play the video
If there are any suggestions please let me know ;
/>
By the way i'm using axWindowsMediaPlayer component
The problem is, When I send this app to someone else, the video will not play.
Already expected this because of this line "axWindowsMediaPlayer1.URL = "C:\file-location-"
So I've put the video in my Resources and has set the property of Build=Embedded resources as you said but now i'm stuck even after doing this i am not able to play the video
If there are any suggestions please let me know ;
This post has been edited by CY5: 16 December 2012 - 07:48 AM
#4
Re: want to know how could i embed video in software.
Posted 16 December 2012 - 09:51 AM
Okay - well do a quick read up of how to use them.. you don't reference them like a file in a directory..
http://msdn.microsof...v=vs.80%29.aspx
http://msdn.microsof...v=vs.71%29.aspx
http://msdn.microsof...v=vs.80%29.aspx
http://msdn.microsof...v=vs.71%29.aspx
#5
Re: want to know how could i embed video in software.
Posted 16 December 2012 - 10:03 AM
CY5, on 16 December 2012 - 08:45 AM, said:
So I've put the video in my Resources and has set the property of Build=Embedded resources as you said but now i'm stuck even after doing this i am not able to play the video
If there are any suggestions please let me know ;
/>/>/>
If there are any suggestions please let me know ;
axWindowsMediaPlayer will not play an embedded resource directly. If you open the Resources tab in the Solution Explorer, you'll see your video. Right click on it, and select Properties. Set "Copy to Output" to "Copy if Newer", and on running your software, the video will show up as a file in your current directory (\bin\Debug or \bin\Release), named the same as the filename you added to the resources.
So the axWindowsMediaPlayer.URL becomes "Resources\OriginalFileName.mp4"
Edit: oops! Didn't see modi's post until just now. Those are both good references.
This post has been edited by lar3ry: 16 December 2012 - 11:08 AM
#6
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 05:00 AM
I tried this even to it was not working
#7
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 07:03 AM
#8
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 07:55 AM
Hey i asked my friend about these he say "After putting video in resources you have to put the path, but the path should be relative not absolute. and says to check path convention online".
As i am mewbie to vb.net i need help on path convention so that i could solve out the problem.
As i am mewbie to vb.net i need help on path convention so that i could solve out the problem.
#9
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 08:33 AM
If you want to play embedded video, you'll have to provide file path as string to URL property of AxWindowsMediaPlayer. You can't provide path from your resources, because resources are compiled into executable, and you can't direct player to read from inside exe location. So you'll have to save resource file somewhere, if you want to play it, and know where it's saved, to give the location to URL property of player. Meaning you need common writable location on every computer. One of such would usually be: My.Computer.FileSystem.SpecialDirectories.Temp
So if you have something like this when your application starts (let's say you have a form project):
it would probably do what you want. It will save video file from resources to Temp directory on each computer, and then use this path to play it.
So if you have something like this when your application starts (let's say you have a form project):
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
IO.File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\NameOfVideFile.wmv", My.Resources.NameOfVideFile)
AxWindowsMediaPlayer1.URL = My.Computer.FileSystem.SpecialDirectories.Temp & "\NameOfVideFile.wmv"
End Sub
it would probably do what you want. It will save video file from resources to Temp directory on each computer, and then use this path to play it.
#10
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 09:57 AM
#11
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 10:12 AM
#12
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 10:14 AM
Thanks you friends
#13
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 10:53 AM
Quote
If you want to play embedded video, you'll have to provide file path as string to URL property of AxWindowsMediaPlayer. You can't provide path from your resources, because resources are compiled into executable, and you can't direct player to read from inside exe location. So you'll have to save resource file somewhere, if you want to play it, and know where it's saved, to give the location to URL property of player. Meaning you need common writable location on every computer
The way u r making is probably an exe , but in this case the user has to put the resource file in the location told by the developer ,, which no user wants to do.
#14
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 10:57 AM
CY5 I'm not really sure what you are saying here, but if you are concerned that user would need to manually save the file to some location specified by developer, you don't need to worry. The file in my code snippet is saved by the code to Temp directory of the Windows OS. Go ahead, and try it.
#15
Re: want to know how could i embed video in software.
Posted 17 December 2012 - 11:10 AM
Thanks Lucky3 it worked
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote








|