使用HTA应用程序播放直播

问题描述 投票:2回答:1

我有一个直播,我想在我的HTA应用程序上播放。

我已经尝试使用 本回答.

<head>
     <title>Main</title>
     <meta http-equiv="x-ua-compatible" content="ie=edge" />
</head>

<body>
    <bgsound>
    <button onclick="playSound()">Play</button>

    <script language="javascript">
    function playSound() {
        document.getElementsByTagName("bgsound")[0].src = "https://www.url.org/stream";
    }
    </script>

</body>
</html>

(是的,我遗漏了很多,但这不应该妨碍它的运行)

我按了播放键,但什么也没发生。 我如何让它工作?

windows audio streaming desktop-application hta
1个回答
0
投票

你可以给一个尝试与嵌入标签。

<embed src="url.to/stream" type="video/mp4" autoplay="1"/>

我刚刚在我的windows 10上测试了一下,它的工作原理就像这个例子。

<html>
<head>
<title>Embedded video into HTA</title>
<HTA:APPLICATION
  APPLICATIONNAME="Embedded video"
  ID="Embedded video"
  ICON="nslookup.exe"
  WINDOWSTATE="maximize"
  VERSION="1.0"/>
<style>
body {
color:white;
background-color:lightblue;
background-image:url('https://apod.nasa.gov/apod/image/2001/DesertEclipse_Daviron_2000.jpg');
background-repeat:repeat;
background-size: 100%;
}
</style>
<script type="text/vbscript">
Sub Reload()
    window.location.reload(True)
End Sub
</script>
</head>
<body>
<center>
<br><hr>
<embed src="http://94.23.221.158:9197/stream" width=50% height=45% type="video/mp4" autoplay="1"/>
<br><hr>
<img src="http://www.icone-png.com/png/23/22961.png" Title="Reload Application video" alt="Reload Application video" onclick="Reload()" style="cursor:hand">
</center>
</body>
</html>
© www.soinside.com 2019 - 2024. All rights reserved.