I have been fighting with this for month. I know that this is not going to get everywhere but I want to share the resolution with a bit of backstory.
I have been creating unattended installations for everything under the sun and it has been going really well except that it's... well, unattended and mostly hidden so that I did not know where it was in its progress or anything else for that matter. I decided then to use an HTA file instead of Powershell or VBScript alone. Figured it would give me something to look at while all this was happening. Cool, right? Almost a year of working on it and trying every different devolving code I could find. Today that paid off.
I found the same code you used with the OBJECT instead of a common VIDEO tag. It was clunky and more code that I wanted to write but it worked... mostly. I could not send CSS references to it (ie. OPACITY:.5) or even position the darn thing. I found I could using the IE=7 or 8 references make slight changes, but then scripting it (VBScript) was almost impossible. Could not find the references that would work all the time. Alternately, switching to IE9 - IE11 broke the rest of my code. None of the calls or refs made sense.
Ultimately, it was a whole lot easier than anything I had found! SO much wasted time to get back to the very beginning...C'est la vie! Here is my code, though for privacy I've removed my personal domain and made everything local. It works, though not as efficiently as using a stream. Hope this helps. Share it with everyone!
Note: for fun I've opted to show my custom Office 365 install. Obviously I could make this fully unattended, but I just used the files rather than allowing the download function!
<meta http-equiv="X-UA-Compatible" content="IE=8;IE=9" />
^^^ This is KEY! ^^^
<html>
<head>
<TITLE>Office 365 Installer</TITLE>
<hta:application id="O365TK"
applicationname="O365TK"
border="none"
caption="no"
icon=".\MEDIA\myico.ico"
showintaskbar="no"
singleinstance="yes"
sysmenu="no"
windowstate="maximize"
>
<style>
body{overflow:hidden;background:black;}
#proc{position:absolute;top:400px;left:20px;color:red;background:black;opacity:.3;}
#BG{position:absolute;top:0;left:0;z-index:-1;}
#myhead{position: absolute; top:0;left:0;z-index:0;}
#myvideo{position:absolute;top:0;left:0;height:100%;z-index:1; opacity:.5;}
</style>
</head>
<body>
<img id="BG">
<video id=myvideo type="video/mp4" autoplay src=".\MEDIA\cot.mp4"></video>
<div id="proc">Click Here to Start!</div>
<img id="myhead" src=".\MEDIA\label.png">
<script language="vbscript">
x = 5
Set ws = createobject("wscript.shell")
set fs = createobject("scripting.filesystemobject")
set sa = createobject("shell.application")
Sub window_onload
sa.MinimizeAll
pc=setInterval("pic_changer()",3000)
setTimeout "clicker()",4000
setTimeout "musicbox()", 3200
settimeout "pic_changer()",10
End Sub
Sub window_onbeforeunload()
'Set cd=location.pathname
Unloader()
End Sub
Function wait()
ws.Run "wait.vbs",0,1
'Lots of ways to go about putting a pause in the transmission.
'I use an external vbs file with one line: wscript.sleep 1000 That's all!
window.focus
End Function
Function document_onclick()
myvideo.stop
musicbox()
End Function
Sub document_onkeypress()
If window.event.keyCode=27 Then
Unloader
End if
End sub
Function proc_onclick()
'proc.innerhtml = "Download Office...<br>Please wait."
'wait:wait
'ws.run ".\Setup /configure .\TKO365.xml",0,1
proc.innerhtml = "Packaging Office...<br>Please wait."
wait:wait
ws.run ".\Setup /packager .\TKO365.xml .\Office",0,1
wait:wait
proc.innerhtml = "Install Office...<br>Please wait."
wait:wait
ws.run ".\Setup /configure .\TKO365.xml",0,1
proc.innerhtml = "Customize Office!<br>Please wait."
wait:wait
ws.run ".\Setup /customize .\TKO365.xml",0,1
wait:wait
proc.innerhtml = "Mission Complete!<br>We're done here!"
wait:wait
proc.innerhtml = "Goodbye!"
wait
Unloader()
End Function
Function Unloader()
clearInterval(pc)
sa.UndoMinimizeALL
ws.run "taskkill /f /im wscript.exe",0
ws.run "taskkill /f /im mshta.exe",0
End Function
Function clicker()
do while x => 0
proc.innerhtml="Autostart in " & x & " seconds"
wait
x = x-1
Loop
proc.click()
end Function
Function musicbox()
max=230
min=1
Randomize
d = Int((max-min+1)*Rnd+min)
t = ".\MEDIA\" & d & ".mp4"
'I renamed 230 tracks 1-230 for ease of calling them
myvideo.filename=t
myvideo.play
End Function
Function pic_changer()
Randomize
'Set ddd = document.getelementbyid("BG")
' I've left the above line for a sign of how horribly convoluted
'things got when using IE8 and below. BG already exists.
'I did not need to create another variable for it,
'though this is what I had been forced to do with those other iterations of IE
dd = Int(Rnd*230)+1
bg.src=".\MEDIA\"& dd &".jpg"
With bg.style
.display="block"
.width="100%"
.position="absolute"
.top="0px"
.left="0px"
.backgroundRepeat="no-repeat"
End With
window.focus
End Function
</script>