]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
added comments to video.js to explain functions
authorDaniel Hodgin <hodgin.daniel@gmail.com>
Mon, 31 May 2010 21:17:47 +0000 (17:17 -0400)
committerDaniel Hodgin <hodgin.daniel@gmail.com>
Mon, 31 May 2010 21:17:47 +0000 (17:17 -0400)
video.js

index d29696e9d3011cd48d700f93afc44026b0af80f9..1b8ce7bfdfd3fb3dee27dce9921564006544f7f6 100644 (file)
--- a/video.js
+++ b/video.js
@@ -1,3 +1,4 @@
+// fire when DOM is ready, jQuery shortcut for $(document).ready
 $(function() {
         $("video").each(function() {
                 if (lang=window.location.search.substring(1)) {
@@ -20,6 +21,7 @@ $(function() {
 });
 
 var lt = 0;
+// fires when ontimeupdate() runs from <video> tag
 function update(vid) {
         var has_sub=false,
         t = vid.currentTime; 
@@ -64,6 +66,7 @@ function update(vid) {
         lt = t;
 }
 
+// convert time format mm:ss to seconds integer
 function to_secs(time) {
        var t = time.split(":");
        return parseInt(t[0]*60,10) + parseInt(t[1],10);