加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 具有WPF WebBrowser控件的本地网页中的VLC ActiveX

发布时间:2020-12-15 21:47:16 所属栏目:百科 来源:网络整理
导读:所以我尝试在 WPF WebBrowser控件下运行VLC ActiveX v.2并在本地加载它. 并且VLC ActiveX无法正常工作…… C# void MainWindow_Loaded(object sender,RoutedEventArgs e){ var file = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,
所以我尝试在 WPF WebBrowser控件下运行VLC ActiveX v.2并在本地加载它.

并且VLC ActiveX无法正常工作……

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>

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

此外,我试图像使用嵌入式资源一样使用index.html.

所以我用过

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

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

任何线索?

附:我试图用WInForm WebBrowser控件做同样的事情 – 没有快乐……

P.S.#2我尝试过这个项目http://www.codeproject.com/Articles/3919/Using-the-WebBrowser-control-simplified,与VLC ActiveX相同的HTML在那里工作得很好.
但它是在C完成,我根本不知道…

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读