Dynamically create a HTML5 video element without it being shown in the page
问题 Is it possible to dynamically create a HTML5 video element so that I can access the element by API's like document.getElementById or Name but it may not show up in the webpage. Something like div.hide() or something in that direction ? 回答1: You can try var video = document.createElement('video'); video.src = 'urlToVideo.ogg'; video.autoplay = true; you can also use the canPlayType method to check if the browser supports the video format you want to use before setting source if (video