Created
September 29, 2015 15:21
-
-
Save mandrasch/77c2c38dcf664de430b3 to your computer and use it in GitHub Desktop.
Twine2 Sugarcube2 Skip video in passage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- video must be initialized in storyinit before, see: https://gist.github.com/programmieraffe/b0ae841d1961e038d87a --> | |
| <a id="skip-video">Skip intro video</a><span id="next-step" style="display:none;">[[2025|Prelude]]</span><<html5playvideo "wasteland" 53>> | |
| <<script>> | |
| $( document ).ready(function() { | |
| $("#story").hide().delay(3000).fadeIn(1500); | |
| /* thank to http://stackoverflow.com/a/2880950/809939 */ | |
| document.getElementById('wasteland').addEventListener('ended',myHandler,false); | |
| function myHandler(e) { | |
| if(!e) { | |
| e = window.event; | |
| } | |
| $("#skip-video").hide(); | |
| $("#next-step").show(); | |
| $("#story").fadeIn(1500); | |
| } | |
| $( document ).on( "click", "#passage-introvideo > a#skip-video",function(){ | |
| $("#story").hide(); | |
| console.log('skip click'); | |
| $(this).hide(); | |
| var video = document.getElementById('wasteland'); | |
| video.pause(); | |
| video.currentTime = 93; | |
| video.play(); | |
| /*$("#next-step").fadeIn(1500);*/ | |
| }); /* eo skip video */ | |
| }); /* eo ready */ | |
| <</script>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment