Mit diesem Code wird zur Laufzeit ein .mp4 Video in eine HTML Webseite eigebettet.
HTML5, javascript
//--< add Video-Player >-- var divEditor = document.getElementById("ctlEditor_HTML");
//*show uploaded Image in div-Results var br = document.createElement("br"); divEditor.insertBefore(br, divEditor.childNodes[0]);
//< create image > var video = document.createElement("video"); video.src = "/User_Files/Notes/Videos/" + item + ".mp4" video.setAttribute("width","640"); video.setAttribute("height", "480"); video.setAttribute("controls",""); video.setAttribute("autoplay",""); video.style.width = "100%"; video.style.maxWidth = "100%"; video.style.height = "auto"; video.style.display = "block"; video.style.borderWidth = "2px"; video.style.borderColor = "black"; video.style.borderStyle = "solid"; //</ create image >
//*at position 0 divEditor.insertBefore(video, divEditor.childNodes[0]); //--</ add Video-Player >-- |
<video src="/User_Files/Notes/Videos/Video_338_0.mp4" width="640" height="480" controls="" autoplay="" style="width: 100%; max-width: 100%; height: auto; display: block; border-width: 2px; border-color: black; border-style: solid;"></video> |