I have a video element:
var video = window.content.document.createElement(\"video\"); video.width = width; video.height = height; video.style.backgroundColor =
"loadeddata" should only fire once. It's better to use "timeupdate" to repeatedly check if the video width and height have been set, in particular with getUserMedia where you don't really pause the video, but go straight into playback.