Steffane Cheebs Timm
Steffane Cheebs Timm

Reputation: 11

How do I embed a video into a Konami Javascript code?

Ok. I understand how to embed a video using scripts and I got the konami code working on my website--it currently has an alert. What I do not understand is how to have a video popup in lightbox or fancybox. Or if that isn't possible, how to link to a page inside my site so they can view the video there.

Current js and jquery:

<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/konami-JS.js"></script>

<script type="text/javascript">
    konami = new Konami()
    konami.code = function() {
        alert("You have entered the KONAMI CODE!  You now have 30 lives.  Kinda.")
    }

konami.load()
</script>

This is my site "http://webdesign.miad.edu/stimm/" and as you can see, if you enter the Konami code (up, up, down, down, left, right, left, right, b, a, enter), there is currently an alert. So everything works. It's just not what I want.

Any help is appreciated...thank you so much!

Upvotes: 1

Views: 381

Answers (1)

epascarello
epascarello

Reputation: 207501

Well if you care only about modern day browsers, you can append a video tag to the page.

var video = document.createElement('video');
document.getElementById('WhereYouWantItOnPageId').appendChild(video);
video.setAttribute('src', 'yourMovie.mp4');
video.play();

Upvotes: 1

Related Questions