为什么我的视频在我的VBS HTA应用程序的模态对话框窗口中没有显示?

huangapple go评论50阅读模式
英文:

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>标签。

选项:

  1. 重新设计您的HTA以不使用ShowModalDialog。

  2. 将您的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:

  1. Redesign your HTA to not use ShowModalDialog.

  2. 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.

huangapple
  • 本文由 发表于 2023年6月2日 01:07:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76384197.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定