VLC的ActiveX在当地的网页使用WPF WebBrowser控件 [英] VLC ActiveX in a local webpage with WPF WebBrowser control

查看:233
本文介绍了VLC的ActiveX在当地的网页使用WPF WebBrowser控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我试图让工作 VLC的ActiveX第2节 WPF WebBrowser控件,然后我在本地加载它。

So I try to get working VLC ActiveX v.2 under WPF WebBrowser control and I load it locally.

和VLC的ActiveX不工作...

And VLC ActiveX is not working...

C#

void MainWindow_Loaded(object sender, RoutedEventArgs e)
{ 
  var file = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "index.html");

 using (StreamReader sr = new StreamReader(file))
 {
     String url = sr.ReadToEnd();
     wb.NavigateToString(url);
  }
}

HTML

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9">
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />
    <title></title>
</head>
<body>
    <object width="720" height="408" id='vlc1_IE' events="True" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921">
        <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
            width="720" height="408"
            id="vlc1">
        </embed>
        <param name="src" value="http://content.bitsontherun.com/videos/bkaovAYt-52qL9xLP.mp4" />
        <param name="ShowDisplay" value="True" />
        <param name="AutoPlay" value="False" />
    </object>
</body>
</html>

请注意,如果我加载远程它工作正常!

Please note if I load it remotely it is working fine!

此外,我曾尝试使用的index.html像一个嵌入的资源。

Also I have tried to use index.html like an embedded resource.

所以我使用了

Stream docStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("WpfApplication12.index.html");
wb.NavigateToStream(docStream);

是否有可能呢?是WPF WebBrowser控件非常有限使用ActiveX执行本地网页?

Is it possible to do? Is WPF WebBrowser control very limited to execute local web page with ActiveX?

任何线索?

P.S。我试着与Winform的WebBrowser控件做同样的 - 没有喜悦......

P.S. I've tried to do the same with WInForm WebBrowser control - no joy...

PS#2我已经试过这个项目 HTTP://www.$c$cproject.com/Articles/3919/Using-the-WebBrowser-control-simplified 和相同的HTML与VLC的ActiveX工作正常存在。 但是,这样做是在C ++中,我不知道它在所有...:(

P.S.#2 I've tried this project http://www.codeproject.com/Articles/3919/Using-the-WebBrowser-control-simplified and the same HTML with VLC ActiveX is working fine there. But it is done in C++ and I dont know it at all... :(

P.S。 #3我只是试着在一起MS Media Player和VLC ActiveX和微软媒体播放器工作正常!

P.S. #3 I've just tried together MS Media Player and VLC ActiveX and MS Media Player is working fine!

  <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
            width="720" height="408"
            id="vlc1">
        </embed>

    <object classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"
        <param name="URL" value="example.wmv" >
        </object>

PS#4我也尝试过使用动态的这个的例子,但没有快乐可言?

P.S.#4 Also I have tried to create VLC ActiveX control dynamically using this example but no joy at all...

推荐答案

对此评论:

请注意,如果我加载远程它工作正常!

Please note if I load it remotely it is working fine!

您使用Internet Explorer为这个测试?如果是这样,你有什么插件?

Are you using Internet Explorer for this test? If so, do you have any plugins?

我问这个问题,因为WebBrowser控件(至少在的WinForms)做的不可以支持插件/加载项。仅仅因为一些工作在您完全成熟的浏览器并不一定意味着它会在web浏览器。如果您使用的ActiveX插件该VLC整合,这可能不会在WebBrowser控件的工作。

I ask this question because the WebBrowser control (at least in WinForms) does not support plugins / add-ons. Just because something works in your full-blown browser does not necessarily mean that it will work in the WebBrowser. If you are using an ActiveX plugin for this VLC integration, this likely won't work in the WebBrowser control.

编辑回应评论

当你试试这个code(请注意,我已经改变了你的第二个行略):

When you try this code (and note that I've changed your second line slightly):

Stream docStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("WpfApplication12.index.html");
wb.NavigateToStream(docStream);

...你说,它根本不加载HTML ?或者它加载,但您的视频(VLC)控制不起作用?

...are you saying that it doesn't load the HTML at all? Or does it load, but your video (VLC) control doesn't work?

这篇关于VLC的ActiveX在当地的网页使用WPF WebBrowser控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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