how to control media player using script or code

2019-08-24 07:40发布

问题:

Is there a media player, where you can control its audio and video using script or code.for example lets say i want to pause the video after n secs, which player supports this? I am looking for free opensource solution which runs on desktop i.e windows 7.

回答1:

I'm not the kind of giving the entire solution. But here's a good place to start. It shows how to embed Windows Media Player in a Windows Form.

http://msdn.microsoft.com/en-us/library/bb383953(v=vs.90).aspx

You'll have access to control like play, stop, etc.



回答2:

VideoLan supports such use.

For instance, see here: http://www.videolan.org/doc/play-howto/en/ch04.html

From the link:

--extraintf allows you to select extra interface modules that will be launched in addition to the main one. This is mainly useful for special control interfaces, like HTTP, RC (Remote Control), ... (see below)

The RC interface is probably best from a pure code/script point-of-view.

The HTTP interface is oriented towards a human using a webpage, but could be controlled from code, too.