1 decade ago by SlotGamer
Does anyone have a code snippet of how they successfully play a video in ImpactJS?
I am looking for a way to integrate the video into a class to be displayed similar to how images are done. I know how to play a video in HTML5 with the <video> tag, but I'm not sure how to integrate it into an ImpactJS class.
Should I wrap it with a class and then play the video with HTML5 like this:
<video id="video1" width="320" height="240" controls>
<source src=http://www.html5rocks.com/en/tutorials/video/basics/Chrome_ImF.mp4 type=video/mp4>
</video>
<script>
var myVideo=document.getElementById("video1");
myVideo.play();
</script>
----------------
I would like to place these videos anywhere on the screen but I'm not sure how. I assume I need to get these videos onto the canvas (maybe they already are on the canvas).
Maybe there is an ImpactJS plugin that will help play movies but I cannot seem to find one.
I searched the forum but I cannot find much about accomplishing this except for links to playing a movie in HTML5 using the <video> tag which I already see how to do.
Should I grab the movie from the canvas and make an image out of it for each frame? This sounds overly complicated so I'm thinking that is not the right approach.
I appreciate any help you can give.
Thanks!
I am looking for a way to integrate the video into a class to be displayed similar to how images are done. I know how to play a video in HTML5 with the <video> tag, but I'm not sure how to integrate it into an ImpactJS class.
Should I wrap it with a class and then play the video with HTML5 like this:
<video id="video1" width="320" height="240" controls>
<source src=http://www.html5rocks.com/en/tutorials/video/basics/Chrome_ImF.mp4 type=video/mp4>
</video>
<script>
var myVideo=document.getElementById("video1");
myVideo.play();
</script>
----------------
I would like to place these videos anywhere on the screen but I'm not sure how. I assume I need to get these videos onto the canvas (maybe they already are on the canvas).
Maybe there is an ImpactJS plugin that will help play movies but I cannot seem to find one.
I searched the forum but I cannot find much about accomplishing this except for links to playing a movie in HTML5 using the <video> tag which I already see how to do.
Should I grab the movie from the canvas and make an image out of it for each frame? This sounds overly complicated so I'm thinking that is not the right approach.
I appreciate any help you can give.
Thanks!