is there any command to pause, stop and close vlc

2019-02-25 09:33发布

问题:

Well i have an adobe air which runs vlc-player at background as service. i check that in Windows Task Manager , the service runs when air application launches. here is the code

    processArgs.push("--extraintf");
 processArgs.push("rc"); //Remote control
 processArgs.push("--rc-fake-tty"); //Use terminal as output
 processArgs.push("screen://");
    processArgs.push(":screen-fps=15");
    processArgs.push(":screen-caching=100");
    processArgs.push(":sout=#transcode{venc=x264{bframes=0,nocabac,ref=1,nf,level=13,crf=24,partitions=none},vcodec=h264,fps=15,vb=3000,width=800,height=600,acodec=none}:duplicate{dst=std{mux=mp4,access=file,dst='"+targetFile.nativePath+"'}}");
    startupInfo.arguments = processArgs;

 p = new NativeProcess();
 p.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
 p.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
 p.addEventListener(NativeProcessExitEvent.EXIT, onExit);

now i want to close vlc-player on the button click event and i have searched the vlc- documents and found quit command and its syntax, it does not work as i have tried that syntax from windows command prompt also.. Which are the vlc-player commands that can pause,stop and close vlc-player?? Any useful link will be much helpful to me..

回答1:

I've had quite a look around and looks like this (--rc-fake-tty) can't be done from Windows command line. Which means your current approach is out.

I don't no anything about Adobe but I have done some searching around and this guy has something written in C using the libVLC. Not sure if that will help or point you in the right direction.

The other thing I found was this post Adobe Air and VLC player which mentions that you should be able to use javascript and ActiveX controls on Windows. A guy in this forum has a javascript script which uses an ActiveX control to start, stop, pause etc.

There is a VLC command that you can send to override or set certain hotkeys. Search for next, prev, stop, quit, vol-up, etc in this document.

That's the best of my Googling abilities, hope it helps.



回答2:

I dont want to agree that your code runs well on windows, becasue --rc-fake-tty will not run on windows, to hide the entire vlc window (it will be listed among the processes in Windows Task Manager) use --rc-quiet but to see command window use --no-rc-quiet.

To stop and quit using p.standardInput.writeUTFBytes("stop" + "\n"); is not working for me as well.



标签: flex flex3 air vlc