944,073 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 9401
  • C# RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Nov 5th, 2009
0
Re: How to play Video?
Click to Expand / Collapse  Quote originally posted by VibhorG ...
Hi all,
Can anyone tell me how can we play the video(.wmv) in C# window application .................?
Take a look at this also.
http://www.codeproject.com/KB/direct...diaplayer.aspx
Last edited by avirag; Nov 5th, 2009 at 2:34 am.
Reputation Points: 31
Solved Threads: 36
Posting Whiz
avirag is offline Offline
312 posts
since Jun 2009
Nov 5th, 2009
0
Re: How to play Video?
Vibhorg -- Adatapost provided the article you should read regarding embedding the media player. Take a look and see if that solution meets your needs.

Click to Expand / Collapse  Quote originally posted by VibhorG ...
Well sknake i have done whatever you mentioned here,
BUt now tell me how can i run the video inside this........?
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Nov 5th, 2009
0
Re: How to play Video?
Click to Expand / Collapse  Quote originally posted by sknake ...
Vibhorg -- Adatapost provided the article you should read regarding embedding the media player. Take a look and see if that solution meets your needs.
Yes, but i just have one query regarding this, that the code behind the play button is:
C# Syntax (Toggle Plain Text)
  1. axWindowsMediaPlayer1.URL = @"C:\Documents and Settings\All Users\Documents\My Music\Sample Music\Videofile.wmv";
In this it is load the video from our system(hard drive of user), but in my application i have inbuilt some videos with it, and i want that when user click on play button so video load from that location(In to my application).
Kindly help me in that Sknake..
Last edited by VibhorG; Nov 5th, 2009 at 3:05 am.
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
VibhorG is offline Offline
71 posts
since Aug 2009
Nov 5th, 2009
0
Re: How to play Video?
This depends how you have the videos inbuilt. If they're compiled in as an embedded resource you could do something like:

C# Syntax (Toggle Plain Text)
  1. private void button3_Click(object sender, EventArgs e)
  2. {
  3. string tmpFile = System.IO.Path.GetTempFileName();
  4. File.WriteAllBytes(tmpFile, Properties.Resources.File_MOV);
  5. //mediaPlayer.URL = tmpFile;
  6. //mediaPlayer.Play();
  7. }

Be sure to clean up your temp files when the application closes.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Nov 5th, 2009
0
Re: How to play Video?
Click to Expand / Collapse  Quote originally posted by sknake ...
This depends how you have the videos inbuilt. If they're compiled in as an embedded resource you could do something like:

C# Syntax (Toggle Plain Text)
  1. private void button3_Click(object sender, EventArgs e)
  2. {
  3. string tmpFile = System.IO.Path.GetTempFileName();
  4. File.WriteAllBytes(tmpFile, Properties.Resources.File_MOV);
  5. //mediaPlayer.URL = tmpFile;
  6. //mediaPlayer.Play();
  7. }

Be sure to clean up your temp files when the application closes.
No Sknake this is not what i want,
Let i have a folder(name video) in my application, and i m put(copy) some videos in that folder, now i want to play these videos into my form.
How can i do this ..............
I thing now my problem is clear to you.....
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
VibhorG is offline Offline
71 posts
since Aug 2009
Nov 5th, 2009
0
Re: How to play Video?
Just set the path to C:\Program Files\Wherever you installer your application\Videos\video1.mpg and play the video. I don't understand why this is a problem?
Last edited by sknake; Nov 5th, 2009 at 3:56 am.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Nov 5th, 2009
0
Re: How to play Video?
Click to Expand / Collapse  Quote originally posted by sknake ...
Just set the path to C:\Program Files\Wherever you installer your application\Videos\video1.mpg and play the video. I don't understand why this is a problem?
Okey thank you..........
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
VibhorG is offline Offline
71 posts
since Aug 2009
Nov 5th, 2009
0
Re: How to play Video?
Its a far back reference, but using DirectX is a very good practice. and all windows computers XP and up have DirectX installed. It's installed with windows and comes as an automatic update as well. The managed directX libraries have very easy to use audio and video objects that is as simple as passing it a filepath, giing it a parent control to play on, and calling play.

This is just for future reference. Glad you already have this solved.
Reputation Points: 442
Solved Threads: 89
Master Poster
Diamonddrake is offline Offline
721 posts
since Mar 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: close button event for form
Next Thread in C# Forum Timeline: get name of file opened through file association





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC