英文:
Why does my video not show up in a modal dialog window in my VBS HTA app?
问题
我正在尝试在我的应用程序中创建一个模态对话框,其中会显示一个视频,但视频没有显示出来。但是,当我在主HTA(vbs)中不使用模态对话框函数打开窗口时,它可以正常工作。
Video Player.hta(模态对话框):
<html>
<meta http-equiv="x-ua-compatible" content="ie=9" />
<head>
<title>Video Player</title>
<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="Video Player" BORDER="Dialog" CAPTION="Yes"
SCROLL="No" SHOWINTASKBAR="Yes" SINGLEINSTANCE="Yes" SYSMENU="Yes">
</head>
<body>
<video width="320" height="240" controls>
<source src="C:\Users200791\Desktop\Repos\Audio-Go\movie.mp4">
</video>
</body>
</html>
主HTA函数:
Sub VideoButton_OnClick
If Not document.getElementById("mp3Selector").value = "" Then
Set FSO = CreateObject("Scripting.FileSystemObject")
Pause
FSO.CopyFile document.getElementById("mp3Selector").value, "C:\Users200791\Desktop\Repos\Audio-Go\movie.mp4"
Window.showModalDialog "hta\VideoPlayer.hta", "", "dialogHeight: 228px; dialogWidth: 300px;"
FSO.DeleteFile "C:\Users200791\Desktop\Repos\Audio-Go\movie.mp4"
End If
End Sub
当我运行应用程序时,当我按下VideoButton时,唯一显示的东西是一个带有标题“Video Player”的空白窗口。
英文:
I am trying to create a modal dialog in my app where a video shows up but it doesn't. But when I open the window without using the modal dialog function in the main hta (vbs) it works perfectly.
Video Player.hta (modal dialog):
<html>
<meta http-equiv="x-ua-compatible" content="ie=9" />
<head>
<title>Video Player</title>
<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="Video Player" BORDER="Dialog" CAPTION="Yes"
SCROLL="No" SHOWINTASKBAR="Yes" SINGLEINSTANCE="Yes" SYSMENU="Yes">
</head>
<body>
<video width="320" height="240" controls>
<source src="C:\Users200791\Desktop\Repos\Audio-Go\movie.mp4">
</video>
</body>
</html>
Main hta func:
Sub VideoButton_OnClick
If Not document.getElementById("mp3Selector").value = "" Then
Set FSO = CreateObject("Scripting.FileSystemObject")
Pause
FSO.CopyFile document.getElementById("mp3Selector").value, "C:\Users200791\Desktop\Repos\Audio-Go\movie.mp4"
Window.showModalDialog "hta\VideoPlayer.hta", "", "dialogHeight: 228px; dialogWidth: 300px;"
FSO.DeleteFile "C:\Users200791\Desktop\Repos\Audio-Go\movie.mp4"
End If
End Sub
When I run the app the only thing that shows up when I press the VideoButton is a blank window with the title "Video Player"
答案1
得分: 1
HTA模态对话框(使用ShowModalDialog
)在最高支持IE=8模式下运行,不支持<video>
标签。
选项:
-
重新设计您的HTA以不使用ShowModalDialog。
-
将您的HTA转换为VBSEdit HTML应用程序,其中包含一个改进的模态对话框功能(
window.external.CustomDialog
),可在IE=11模式下运行。
FYI: VBSEdit是来自法国巴黎的开发者创建的工具。
英文:
HTA modal dialogs (using ShowModalDialog
) run in a max of IE=8 mode, which does not support <video>
tags.
Options:
-
Redesign your HTA to not use ShowModalDialog.
-
Convert your HTA to a VBSEdit HTML app which includes an improved modal dialog function (
window.external.CustomDialog
) that runs up to IE=11 mode.
FYI: VBSEdit is from a developer in Paris, France.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论