added video.ogv symlink
[HTML5TV.git] / www / html5tv.js
index f8e14b8..f23bfad 100644 (file)
@@ -16,7 +16,7 @@ function myCarousel_onBeforeAnimation(carousel, state) {
 \r
         var event = carousel.options.customEventManager.getEvent(i - 1);\r
 \r
-        var html = '<img src="' + event.args.src + '" width="117" height="66" alt="' + event.args.description + '" id="' + event.args.id + '" /><div class="thumbnailOverlay">' + event.args.title + '</div>';\r
+        var html = '<img src="' + event.args.src + '" width="' + html5tv.carousel.width + '" height="' + html5tv.carousel.height + '" alt="' + event.args.description + '" id="' + event.args.id + '" /><div class="thumbnailOverlay">' + event.args.title + '</div>';\r
 \r
         carousel.add(i, html);\r
 \r
@@ -24,34 +24,64 @@ function myCarousel_onBeforeAnimation(carousel, state) {
     }\r
 }\r
 \r
+function seek_video(time) {\r
+       var videoElement = $("video#vid").get(0);\r
+       videoElement.currentTime = time;\r
+}\r
+\r
+\r
 function myCarousel_addClickHandler(id, time) {\r
     $("#" + id).click(function() {\r
-        var videoElement = $("video#vid").get(0);\r
-        videoElement.currentTime = time;\r
+               seek_video( time );\r
     });\r
 }\r
 \r
 function chapterChange(isActive, args) {\r
+\r
+//console.debug( isActive, args );\r
+\r
     if (isActive) {\r
         $("#carousel img").css("border-color", "#272928");\r
         $("#" + args.id).css("border-color", "white");\r
         $("#carousel .thumbnailOverlay").css("visibility", "hidden");\r
         $("#" + args.id + " + .thumbnailOverlay").css("visibility", "visible");\r
 \r
+               $('#sub_' + args.index).addClass('active');\r
+\r
         theCarousel.scroll(args.index, true);\r
-    }\r
+    } else {\r
+               $('#sub_' + args.index).removeClass('active');\r
+       }\r
+}\r
+\r
+\r
+function additional_video(isActive, args) {\r
+       var video = $('video#' + args.id);\r
+//console.debug( isActive, args, video );\r
+       if (isActive) {\r
+               $('div#slide').hide();\r
+               video.show();\r
+               video[0].play();\r
+       } else {\r
+               video[0].pause();\r
+               video.hide();\r
+               $('div#slide').show();\r
+       }\r
 }\r
 \r
+\r
 $().ready(function() {\r
-       //console.debug( video_sync );\r
+//console.debug( video_sync );\r
        $("#vid").sync( html5tv.sync );\r
 \r
     $(".toggleContentPanel").click(function() {\r
         var contentPanelId = "#" + ($(this).attr("class")).split(" ")[1];\r
         $(contentPanelId).toggle("blind", {}, 100);\r
+/*\r
         var currentBackground = $(this).css("background-image");\r
         var newBackground = currentBackground.indexOf("Show") >=0 ? "url(contentPanelHide.png)" : "url(contentPanelShow.png)";\r
         $(this).css("background-image", newBackground);\r
+*/\r
     });\r
 \r
     var synchroniser = $("#vid").data("synchroniser");\r
@@ -67,4 +97,12 @@ $().ready(function() {
         initCallback: myCarousel_initCallback,\r
         customEventManager: customEventManager\r
     });\r
+\r
+       $('td.seek_video').click( function() {\r
+//console.debug( 'click', this );\r
+                       var mmss = this.textContent;\r
+                       var to = this.firstChild.hash.replace('#','');\r
+//console.debug( 'seek', mmss, to );\r
+                       seek_video( to );\r
+       } );\r
 });\r