views:

16

answers:

1

I have an image that takes up the window, is the first frame of a video clip and has an "enter" button for the website. When you click "enter" it plays the video and then needs to load the home page.

I have tried HTML5's video tag and the 'onend' method, but no luck. I have tried about 5 different open-source video players-none have scriptable 'onEnd' methods. I have tried setting a "timeout" function equal to the time of the video...no luck.

I normally would do it in Flash, but it has to play on the iPad.

Any help would be greatly appreciated.

Jase

+1  A: 

I believe the event you're looking for is onended, not onend.

zerocrates
+1 and added some link...
Reigel
Wow, thanks for the fast reply. Unfortunately, I have tried that as well. Here is the code I am using:[code]<script type="text/javascript">var videoPlayer = document.getElementsByTagName('video')[0];videoPlayer.onended = function(){ window.location= "http://www.mydomain.net";}</script><video src="../intro6.OGG" autoplay autobuffer />[/code]Thanks again for the quick reply. Am I doing something else wrong?
Jase in ATL
If you're just going to have your script the way you have it written now, your `<script>` element needs to appear below your `<video>` element. The alternative is changing your code to an appropriate event listener so it executes after the DOM is loaded.
zerocrates
Thanks for the reply. I have tried it with the <script> tag after the <video> tag, but I haven't tried the event listener method. I'll try it next. Thanks again.
Jase in ATL
Just tried it with the onload function (with an Alert call to verify that the function is being called) and the alert works, but not the onended. Perhaps it's a problem with Firefox.
Jase in ATL
Here is the latest update: I looked up the DOM specification for onended and it appears that it is a boolean property rather than a function. So I tried setting a timeout to repeatedly look for the onended attribute of the video element to register true, no luck. Maybe this is just not possible.
Jase in ATL