EvilZone

Programming and Scripting => .NET Framework => : gh0st April 19, 2011, 05:01:41 PM

: [VB2010] playvideo with if statement
: gh0st April 19, 2011, 05:01:41 PM
hey guys Im coding my bot atm and I just want to know how to make that part of the source code that is going to activate the video when the if statement is activated for example:

if input is hello -> then that video appear.

 :P best algorithm ever but I always wanted to know how to manipulate the programs from with the script so I hope you guys help me thanx in advance.
: Re: [VB2010] playvideo with if statement
: ande April 19, 2011, 05:08:08 PM
I am not entirely sure what you mean. But from previous talks with you I know you want to make some sort of botish program that will do commands depending on user-input.

So I am guessing you want to do something like this:

:
' Generic command structure: command;argument;argument;argument;argument;argument;
' Command to play video: video;http://youtubeurl.com;
Dim CommandArguments() as string = UserInput.split(";")
If CommandArguments(0) = "video" then
process.start(CommandArguments(1))
' If you want to play other types of videos, like black out the entire screen and play a fullscreen video, you have to look into the windows media player control or directx etc. Look at this; http://www.vbdotnetforums.com/add-development/1701-playing-video-clip-form.html
End if
: Re: [VB2010] playvideo with if statement
: gh0st April 19, 2011, 08:10:23 PM
ande, thanx for your answer but Ive to call for a inner video from my HD not from youtube so once the program reads the input it will make a move and will show up an output like if you were talking with a bot.

http://img856.imageshack.us/i/grgrgrl.png/ (http://img856.imageshack.us/i/grgrgrl.png/)

now you may  have an idea is like when you move a unit in Starcraft 2 it says something.

the algorithm would be

if input = something -> show up a video
or if input = anotherthing -> show up another video

and when the user doesnt input something I will make an animation that is like if the robot is doing the movement you may comprehend
: Re: [VB2010] playvideo with if statement
: ande April 19, 2011, 08:31:32 PM
ande, thanx for your answer but Ive to call for a inner video from my HD not from youtube so once the program reads the input it will make a move and will show up an output like if you were talking with a bot.

http://img856.imageshack.us/i/grgrgrl.png/ (http://img856.imageshack.us/i/grgrgrl.png/)

now you may  have an idea is like when you move a unit in Starcraft 2 it says something.

the algorithm would be

if input = something -> show up a video
or if input = anotherthing -> show up another video

and when the user doesnt input something I will make an animation that is like if the robot is doing the movement you may comprehend

Then I would make a picturebox or panel or something that would be the bot's animation area. Then add Microsoft.DirectX.AudioandVideoPlayback.dll reference to your project and do:

:
Dim WithEvents Vid as new Microsoft.DirectX.AudioandVideoPlayback.Video("c:\vid.avi")
Vid.Owner = picturebox1 ' or panel1 or whatever you choose to be your bot's animation place
Vid.Play()
: Re: [VB2010] playvideo with if statement
: gh0st April 19, 2011, 09:39:15 PM
damn it I get an error
Error   1:Type 'Microsoft.DirectX.AudioandVideoPlayback.Video' is not defined.   
Im looking a video about this atm
this is about how to add a sound but I think that If we add video.play somewhere It could be the answer
http://schoolfreeware.blip.tv/file/4418539/ (http://schoolfreeware.blip.tv/file/4418539/)
: Re: [VB2010] playvideo with if statement
: ande April 19, 2011, 10:00:58 PM
damn it I get an error
Error   1:Type 'Microsoft.DirectX.AudioandVideoPlayback.Video' is not defined.   
Im looking a video about this atm
this is about how to add a sound but I think that If we add video.play somewhere It could be the answer
http://schoolfreeware.blip.tv/file/4418539/ (http://schoolfreeware.blip.tv/file/4418539/)

The my.com.....sound.play does not exist for video as far as I know.

You have to add the reference dll for Microsoft.DirectX.AudioandVideoPlayback.Video in  order to use that class