Skip to content

Commit

Permalink
init stop on second click
Browse files Browse the repository at this point in the history
  • Loading branch information
remstef committed Jun 11, 2017
1 parent fcd6eec commit 4b53bbf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2,725 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@
</style>
<script type="text/javascript">

var lastid = -1;

function showHideTier(clazzid, show) {
console.log("show " + clazzid + " ? " + show);
var arr = new Array();
Expand All @@ -401,38 +403,47 @@

function vidjump(time){
var video = document.getElementsByTagName('video')[0];
if (video!=undefined) {
if (video != undefined) {
video.currentTime=time;
video.play();
} else {
document.getElementsByTagName('audio')[0].currentTime=time;
document.getElementsByTagName('audio')[0].play();
}
}

function vidstop(){
var video = document.getElementsByTagName('video')[0];
if (video != undefined) {
video.stop();
}
}

function vidjumpid(id){
if(typeof id == 'undefined')
return;
if(id[0] == '#')
id = id.substring(1,id.length)
console.log("play " + id)
id = id.substring(1, id.length);
console.log(id);
console.log(lastid);
if(id == lastid) {
vidstop();
return;
}
lastid = id;
var elem = document.getElementById(id);
console.log(elem)
if (typeof elem.click == "function") {
elem.click.apply(elem); // this should invoke vidjump
window.focus();
console.log("play ");
}
}

window.onload = function() {
console.log("onload");
vidjumpid(window.location.hash);
}


</script>
</head>
<body onhashchange="vidjumpid(window.location.hash);">
<body onhashchange="console.log('onhashchange'); vidjumpid(window.location.hash);">

<div id="head">
<span wicket:id="title">Document Title Goes Here!</span>
Expand Down

This file was deleted.

Loading

0 comments on commit 4b53bbf

Please sign in to comment.