从应用程序打开VLC播放器 [英] Opening VLC player from an application

查看:187
本文介绍了从应用程序打开VLC播放器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从C#应用程序控制vlc播放器.最终目标是通过嵌入在WPF应用程序中的vlc播放器流式传输直播电视,但是现在我将完全能够打开并播放它.我找到了AxAXVLC.AxVLCPlugin2插件,并尝试使用以下代码播放文件:

I am trying to control a vlc player from a C# application. The end goal is to stream live TV through a vlc player embeded in a WPF app, however right now I will settle for being able to even open and play it at all. I found the AxAXVLC.AxVLCPlugin2 plugin and have tried using the following code to play a file:

axVLCPlugin21.BeginInit();
                axVLCPlugin21.playlist.add(@"C:test.mp4", null, null);
                axVLCPlugin21.playlist.add(@"C:test2.mp4", null, null);
                axVLCPlugin21.playlist.playItem(0);



这绝对没有任何作用.如果我将playItem值设置为1,则会出现错误,提示vlc需要关闭.我试图在功能上找到docomentation,但似乎没有任何可用的方法.任何帮助将不胜感激,理想情况下是代码示例,但将我指向任何有帮助的网站也将非常有用.

我只是意识到我设置了错误的文件路径,这很糟糕:)它现在可以播放文件,我只需要弄清楚如何实时传输视频即可.



This does absolutely nothing. If I set the playItem value to 1 it comes up with an error saying vlc needs to shut down. I have tried to find docomentation on the functions but there doesn''t seem to be any available. Any help will be appreciated, ideally code examples but pointing me to any websites that will help would be great too.

I just realised I was setting the file paths wrong my bad :) it now plays files i just need to figure out how to stream video live.

推荐答案

而不是嵌入ActiveX版本,请查看 http://vlcdotnet.codeplex.com/ [
Rather than embedding an ActiveX version, maybe take a look at http://vlcdotnet.codeplex.com/[^] and see if it will suit your needs better.


"Vlc.DotNet libraries provide the audio/video control of VideoLan on WinForm (.Net 2.0) or Windows Presentation Foundation (.Net 3.5)"


我认为控制任何二进制文件的最佳选择组件是通过使用COM.尝试获取Binary对象并使用播放列表界面,您可以非常轻松地完成此操作. :-)

axvlc.dll是您必须寻找的COM dll.
-
谢谢!
I think the best option to control any binary component is by using COM. Try to get the Binary object and using the playlist interface, you can do this very easily. :-)

axvlc.dll is the COM dll you must look for.
--
CHEERS!!!


您是否尝试过使用
Have you tried using the Process Class[^]?


这篇关于从应用程序打开VLC播放器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆