Skip to content

Commit

Permalink
FLUID-4826: More progress on interval conductor reconstruction. Havin…
Browse files Browse the repository at this point in the history
…g issues with setting interval list into conductor when the transcript is loaded.
  • Loading branch information
cindyli committed Jan 24, 2013
1 parent 550455c commit ef170e8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
18 changes: 12 additions & 6 deletions js/VideoPlayer.js
Expand Up @@ -198,10 +198,6 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
onTranscriptShow: "{videoPlayer}.events.onTranscriptShow",
onTranscriptElementChange: "{videoPlayer}.events.onTranscriptElementChange",
onTranscriptsLoaded: "{videoPlayer}.events.onTranscriptsLoaded"//,
// onIntervalChange: "{intervalEventsConductor}.events.onIntervalChange"
},
listeners: {
// onTranscriptsLoaded: "{intervalEventsConductor}.setIntervalList"
}
}
},
Expand All @@ -213,7 +209,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
onTimeUpdate: "{videoPlayer}.events.onTimeUpdate"
},
listeners: {
onReady: "{videoPlayer}.events.onIntervalEventsConductorReady"
// onReady: "{videoPlayer}.events.onIntervalEventsConductorReady"
"{transcript}.events.onTranscriptLoaded": "{intervalEventsConductor}.setIntervalList"
// "{transcript}.events.onTranscriptsLoaded": function () {console.log("loaded is fired");}
}
}
},
Expand Down Expand Up @@ -748,12 +746,20 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
/*************************************************************************************
* The wiring up of the onTick event btw timer component and intervalEventsConductor *
*************************************************************************************/
fluid.demands("fluid.videoPlayer.media", ["fluid.videoPlayer.intervalEventsConductor"], {
fluid.demands("fluid.videoPlayer.media", ["fluid.videoPlayer.intervalEventsConductor", "fluid.videoPlayer"], {
options: {
events: {
onTimeUpdate: "{intervalEventsConductor}.events.onTimeUpdate"
}
}
});

// fluid.demands("fluid.videoPlayer.transcript", ["fluid.videoPlayer.intervalEventsConductor", "fluid.videoPlayer"], {
// options: {
// listeners: {
// onTranscriptsLoaded: "{intervalEventsConductor}.setIntervalList"
// }
// }
// });

})(jQuery);
20 changes: 8 additions & 12 deletions js/VideoPlayer_intervalEventsConductor.js
Expand Up @@ -17,17 +17,6 @@ https://source.fluidproject.org/svn/LICENSE.txt

(function ($) {

/*************************************************************************************
* The wiring up of the onTick event btw timer component and intervalEventsConductor *
*************************************************************************************/
// fluid.demands("fluid.videoPlayer.html5MediaTimer", ["fluid.videoPlayer.intervalEventsConductor"], {
// options: {
// events: {
// onTick: "{intervalEventsConductor}.events.onTick"
// }
// }
// });

/*********************************************************************************
* fluid.videoPlayer.intervalEventsConductor *
* *
Expand Down Expand Up @@ -59,7 +48,7 @@ https://source.fluidproject.org/svn/LICENSE.txt
args: ["{fluid.videoPlayer.intervalEventsConductor}", "{arguments}.0"]
}
},

preInitFunction: "fluid.videoPlayer.intervalEventsConductor.preInit",
// An array of the time intervals with all the begin and end time in millisecond
// Example: Array[intervalID] = {begin: beginTimeInMilli, end: endTimeInMilli}
intervalList: [],
Expand All @@ -70,8 +59,15 @@ https://source.fluidproject.org/svn/LICENSE.txt
}
});

fluid.videoPlayer.intervalEventsConductor.preInit = function (that) {
that.setIntervalList = function (intervalList) {
that.setIntervalList(intervalList);
};
};

fluid.videoPlayer.intervalEventsConductor.setIntervalList = function (that, intervalList) {
that.options.intervalList = intervalList;
console.log("intervalList is set to: " + that.options.intervalList);
};

fluid.videoPlayer.intervalEventsConductor.inInterval = function (currentTimeInMillis, interval) {
Expand Down
18 changes: 9 additions & 9 deletions js/VideoPlayer_media.js
Expand Up @@ -31,15 +31,15 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
mediaEventBinder: {
type: "fluid.videoPlayer.eventBinder",
createOnEvent: "onEventBindingReady"
},
intervalEventsConductor: {
type: "fluid.videoPlayer.intervalEventsConductor",
createOnEvent: "onEventBindingReady"
},
transcript: {
type: "fluid.videoPlayer.transcript",
createOnEvent: "onEventBindingReady"
}
}//,
// intervalEventsConductor: {
// type: "fluid.videoPlayer.intervalEventsConductor",
// createOnEvent: "onEventBindingReady"
// },
// transcript: {
// type: "fluid.videoPlayer.transcript",
// createOnEvent: "onEventBindingReady"
// }
},
finalInitFunction: "fluid.videoPlayer.media.finalInit",
preInitFunction: "fluid.videoPlayer.media.preInit",
Expand Down

0 comments on commit ef170e8

Please sign in to comment.