Greg
Greg

Reputation: 1723

Open a video at a particular time

In my program it is possible to make certain files open externally in whichever program is their file type default. I do this with:

Process p = new Process();
p.StartInfo.FileName = "path of file I want to open";

//open the file:
p.Start();

In the case of video files, I want to open the video (in Windows Media Player, - my question is specific to WMV files), and jump to a particular time within the video.

Is it possible to do this? I'm aware that Windows Media Player can be embedded, but I'm keen to avoid this if possible as it will require the inclusion of some DLLs.

Upvotes: 1

Views: 1928

Answers (2)

igorushi
igorushi

Reputation: 1995

If you have to use Windows Media Player the answer is no, there is no such command line parameter, you can find full WMP parameters list here.

If you can use VLC it has a --start-time parameter.

Upvotes: 2

user4356796
user4356796

Reputation:

That would depend on whether or not you can actually jump to a certain time and/or frame using the commandline arguments of whichever program is loaded. In this case, Windows Media Player.

Have a look at https://msdn.microsoft.com/en-us/library/h6ak8zt5(v=vs.110).aspx

It might be possible to simply do something like:

Process.Start(PathToFile, ArgumentsThatIncludeExactTimeOrFrameIndex);

Although I am not sure whether or not the arguments wouldn't simply get dumped in case the PathToFile is not an executable but simply a file triggering an association; as you have been doing.

Upvotes: 0

Related Questions