ASP.NET 如何使用vlc播放器
时间: 2023-07-20 16:05:18 浏览: 281
要在ASP.NET中使用VLC播放器,你需要执行以下步骤:
1. 下载并安装VLC媒体播放器。
2. 在你的ASP.NET项目中添加对AxInterop.VLCPlugin和Interop.VLCPlugin的引用。
3. 在你的Web.config文件中添加以下配置节:
```xml
<system.web>
<trust level="Full"/>
</system.web>
```
这将允许你的应用程序在浏览器中运行ActiveX控件。
4. 在你的ASP.NET页面中添加以下代码,以在页面上嵌入VLC播放器:
```aspx
<object id="vlc" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab" width="640" height="480">
<param name="src" value="your_video_file_path" />
<param name="autoplay" value="true" />
<param name="showcontrols" value="true" />
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="640" height="480" src="your_video_file_path" autoplay="yes" showcontrols="yes"></embed>
</object>
```
5. 将“your_video_file_path”替换为你要播放的视频文件的路径。
这些步骤将在你的ASP.NET项目中嵌入VLC播放器,并在页面上播放视频。请注意,这只在Internet Explorer中工作,不支持其他浏览器。
阅读全文
相关推荐


















