Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
//index.html
var video = document.createElement('video');
video.id = "videoDisplay";
video.autoPlay = false;
document.body.appendChild(video);
//yourproject.hx
#if html5
var htmlVideo:VideoElement;
htmlVideo = cast(Browser.document.getElementById('videoDisplay'), VideoElement);
htmlVideo.src = videoName;
htmlVideo.style.top = videoY + "px";
htmlVideo.style.left = videoX + "px";
htmlVideo.style.visibility = "hidden";
#end
function play():Void
{
#if html5
duration = Std.int(htmlVideo.duration);
htmlVideo.play();
htmlVideo.style.visibility = "visible";
#end
}
function onUpdate(e:Event):Void
{
#if html5
handleProgression(Std.int(htmlVideo.currentTime) / duration);
#end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment