');
+ _el.css({
+ position: "absolute",
+ top: 0,
+ left: 0,
+ height: _this.height,
+ width: _this.width
+ });
+ _this.$.append(_el);
+
+ _this.insertSubwidget(
+ _el,
+ {
+ type: _this.player_type,
+ media_id: _media.id,
+ height: _this.height,
+ width: _this.width,
+ url_transform: _this.url_transform
+ }
+ );
+
+ _media.loadedMetadata = false;
+ _media.show = function() {
+ _el.show();
+ };
+ _media.hide = function() {
+ _el.hide();
+ };
+ _media.on("loadedmetadata", function() {
+ _media.loadedMetadata = true;
+ var _allLoaded = true;
+ for (var _i = 0; _i < _mashup.medias.length; _i++) {
+ _allLoaded = _allLoaded && _mashup.medias[_i].loadedMetadata;
+ }
+ if (_allLoaded) {
+ changeCurrentAnnotation();
+ _mashup.trigger("loadedmetadata");
+ }
+ });
+ _media.on("timeupdate", function(_time) {
+ if (!_pauseState && _media === _currentMedia) {
+// var _status = "Timeupdate from " + _media.id + " at time " + _time;
+ if ( _time < _segmentEnd ) {
+ if ( _time >= _segmentBegin ) {
+ _timecode = _time - _timedelta;
+// _status += " within segment";
+ } else {
+ _timecode = _segmentBegin - _timedelta;
+ _media.setCurrentTime(_segmentBegin);
+// _status += " before segment";
+ }
+ } else {
+ _timecode = _segmentEnd - _timedelta;
+ _media.pause();
+ changeCurrentAnnotation();
+// _status += " after segment";
+ }
+// _status += " (" + _this.segmentBegin + " to " + _this.segmentEnd + ")" + ", translated to " + _this.timecode;
+// console.log(_status);
+ _mashup.trigger("timeupdate", new IriSP.Model.Time(_timecode));
+ }
+ });
+ _media.on("play", function() {
+ if (_media === _currentMedia) {
+ _mashup.trigger("play");
+ }
+ });
+ _media.on("pause", function() {
+ if (_media === _currentMedia) {
+ _mashup.trigger("pause");
+ }
+ });
+ });
+
+ _mashup.getCurrentTime = function() {
+ return new IriSP.Model.Time(_timecode);
+ }
+ _mashup.getVolume = function() {
+ return ( _currentMedia ? _currentMedia.getVolume() : .5 );
+ }
+ _mashup.getPaused = function() {
+ return _pauseState;
+ }
+ _mashup.getMuted = function() {
+ return ( _currentMedia ? _currentMedia.getMuted() : false );
+ }
+ _mashup.setCurrentTime = function(_milliseconds) {
+ _timecode = _milliseconds;
+ changeCurrentAnnotation();
+ }
+ _mashup.setVolume = function(_vol) {
+ for (var _i = 0; _i < _mashup.medias.length; _i++) {
+ _mashup.medias[_i].setVolume(_vol);
+ }
+ }
+ _mashup.mute = function() {
+ for (var _i = 0; _i < _mashup.medias.length; _i++) {
+ _mashup.medias[_i].mute();
+ }
+ }
+ _mashup.unmute = function() {
+ for (var _i = 0; _i < _mashup.medias.length; _i++) {
+ _mashup.medias[_i].unmute();
+ }
+ }
+ _mashup.play = function() {
+ _pauseState = false;
+ changeCurrentAnnotation();
+ }
+ _mashup.pause = function() {
+ _pauseState = true;
+ if (_currentMedia) {
+ _currentMedia.pause();
+ }
+ }
+
+ changeCurrentAnnotation();
+
+}
\ No newline at end of file
diff -r 2aa7fdb0762a -r ee11ed1b739e src/widgets/Polemic.js
--- a/src/widgets/Polemic.js Mon Sep 17 22:44:59 2012 +0900
+++ b/src/widgets/Polemic.js Tue Sep 18 15:39:28 2012 +0900
@@ -308,7 +308,7 @@
this.$.append('
');
- this.insertSubwidget(this.$.find(".Ldt-Polemic-Tooltip"), "tooltip", { type: "Tooltip" });
+ this.insertSubwidget(this.$.find(".Ldt-Polemic-Tooltip"), { type: "Tooltip" }, "tooltip");
}
IriSP.Widgets.Polemic.prototype.onTimeupdate = function(_time) {
diff -r 2aa7fdb0762a -r ee11ed1b739e src/widgets/PopcornPlayer.js
--- a/src/widgets/PopcornPlayer.js Mon Sep 17 22:44:59 2012 +0900
+++ b/src/widgets/PopcornPlayer.js Tue Sep 18 15:39:28 2012 +0900
@@ -4,12 +4,14 @@
IriSP.Widgets.PopcornPlayer.prototype = new IriSP.Widgets.Widget();
+/* A Popcorn-based player for HTML5 Video, Youtube and Vimeo */
+
IriSP.Widgets.PopcornPlayer.prototype.defaults = {
+ aspect_ratio: 14/9
}
IriSP.Widgets.PopcornPlayer.prototype.draw = function() {
- var _tmpId = Popcorn.guid("video"),
- _videoEl = IriSP.jQuery('