我有一大堆hta文件中的视频链接,我希望链接能够全屏打开VLC媒体播放器来查看它们。这就是我到目前为止所做的:
<HTML>
<HEAD>
</head>
<body>
<a href="file:///C:******\Video1.mp4">Video 1</a>
<a href="file:///C:******\Video2.mp4">Video 2</a>
<a href="file:///C:******\Video3.mp4">Video 3</a>
<a href="file:///C:******\Video4.mp4">Video 4</a>
</body>
</html>
这工作正常,但我会弹出一个“查看或跟踪下载”窗口,并询问我是否要下载文件或打开它。如果我选择“打开”它会打开VLC并播放视频,但我正试图找到一种方法来阻止此弹出窗口的发生。我一直在寻找几天,但找不到答案。我在win8.1上使用ie11。任何帮助将不胜感激。
此外,如果我使用Windows Media Player而不是VLC,则不会弹出消息,但如果我可以使用它,我更喜欢VLC。
感谢您的时间。 格雷格
答案 0 :(得分:0)
单击链接时,可以使用objShell.Run命令和一些vbscript打开mp4文件。请尝试下面的代码。
<HTML>
<head>
<script language="VBScript">
Dim oShell
function openit(myFile)
Set objShell = CreateObject("Wscript.Shell")
objShell.Run myFile
end function
</script>
</head>
<body>
<a href="#" onclick="runit 'file:///C:******\Video1.mp4'" language="vbscript">Video 1</a>
<a href="#" onclick="runit 'file:///C:******\Video2.mp4'" language="vbscript">Video 2</a>
<a href="#" onclick="runit 'file:///C:******\Video3.mp4'" language="vbscript">Video 3</a>
<a href="#" onclick="runit 'file:///C:******\Video4.mp4'" language="vbscript">Video 4</a>
</body>
</html>