所以我尝试在
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完成,我根本不知道…
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。