This commit is contained in:
user
2013-03-11 01:39:49 +01:00
parent 7bc552605f
commit 8b71dfb0f1
3 changed files with 33 additions and 22 deletions

View File

@@ -4,9 +4,11 @@
*{
margin: 0px;
padding: 0px;
font-family: Arial, sans-serif;
font-family: Helvetica,Arial, sans-serif;
width: 100%;
height: 100%;
color: black;
text-decoration: none;
}
html body{
@@ -72,13 +74,18 @@ html body{
background: linear-gradient(to bottom, rgba(155,155,155,1) 0%,rgba(14,14,14,1) 100%);
}
#timeline {
color: white;
color: white;
height: auto;
min-height: 50%;
max-height: 100%;
}
#timeline section {
color: white;
}
#player {
height: auto;
}
#playerlistsec {
@@ -112,6 +119,11 @@ footer{
float: left;
}
#playerlistsec .menu li a{
color: black;
text-decoration: none;
}
#playerlistsec .menu li.select{
height: 5%;
min-height: 50px;
@@ -126,14 +138,9 @@ footer{
}
#sidenav li {
clear: both;
display: list-item;
height: 30px;
width: 100px;
}
#sidenav li.subli {
list-style: circle;
margin-left: 50px;
}
#sidenav ul {
margin-left: 50px;
}

View File

@@ -20,9 +20,7 @@
<ul>
<li>item1</li>
<li>item2</li>
<li>item3</li>
<li class="subli">subitem1</li>
<li class="subli">subitem2</li>
<li><a href="#">item3</a>
<li>item4</li>
</ul>
</nav>

View File

@@ -19,10 +19,11 @@ function pageLoad() {
actTrack = 0;
actChapter = 0;
createPlayList();
jumpById(actTrack, actChapter);
select = document.getElementById('list' + actTrack + '.' + actChapter);
select.setAttribute("class", "select");
jumpById(actTrack, actChapter);
}
function createPlayList() {
@@ -34,10 +35,10 @@ function createPlayList() {
if (trackObj.chapters) {
for (var chapter in trackObj.chapters) {
var chapterObj = trackObj.chapters[chapter];
listEntries = listEntries + "<li id=\"list" + track + "." + chapter + "\" onclick=\"jumpById(" + track + "," + chapter + ");\">" + entryNumber++ + ": " + chapterObj.title + "</li>";
listEntries = listEntries + "<li id=\"list" + track + "." + chapter + "\" onclick=\"jumpById(" + track + "," + chapter + ");\"><a href=\"#\">" + entryNumber++ + ": " + chapterObj.title + "</a></li>";
}
} else {
listEntries = listEntries + "<li id=\"list" + track + ".0\" onclick=\"jumpById(" + track + ",0);\">" + entryNumber++ + ": " + trackObj.title + "</li>";
listEntries = listEntries + "<li id=\"list" + track + ".0\" onclick=\"jumpById(" + track + ",0);\"><a href=\"#\">" + entryNumber++ + ": " + trackObj.title + "</a></li>";
}
}
playList.innerHTML = listEntries;
@@ -58,22 +59,25 @@ function jumpById(trackId, chapterId) {
actTrack = trackId;
actChapter = chapterId;
trackChapChanged(actTrack, actChapter);
mediaSource.src = trackSrc + "#t=" + trackTime;
player.load();
}
function timeUpdate() {
var oldChapter = actChapter;
actChapter = calcChapterId(actTrack, player.currentTime);
bread.innerHTML = createBreadCrumb(actTrack, actChapter);
if (actChapter !== oldChapter) {
trackChapChanged(actTrack, actChapter);
}
}
function createBreadCrumb(trackId, chapterId) {
function trackChapChanged(trackId, chapterId) {
episodeInfo.innerHTML = "";
trackInfo.innerHTML = "";
chapterInfo.innerHTML = "";
episodeInfo.innerHTML = episodeObj.info;
var trackObj = episodeObj.tracks[trackId];
trackInfo.innerHTML = trackObj.info;
@@ -83,11 +87,12 @@ function createBreadCrumb(trackId, chapterId) {
chapterInfo.innerHTML = chapterObj.info;
actNewTitle = actNewTitle + " -> " + chapterObj.title;
}
select.setAttribute("class", "");
select = document.getElementById('list' + actTrack + '.' + actChapter);
select.setAttribute("class", "select");
return actNewTitle;
bread.innerHTML = actNewTitle;
}
function calcChapterId(trackId, time) {
var trackObj = episodeObj.tracks[trackId];
@@ -104,5 +109,6 @@ function calcChapterId(trackId, time) {
}
function trackEnded() {
jumpById(actTrack + 1, 0);
jumpById(actTrack+1, 0);
}