equal
deleted
inserted
replaced
16 } |
16 } |
17 |
17 |
18 IriSP.Widgets.Mediafragment.prototype = new IriSP.Widgets.Widget(); |
18 IriSP.Widgets.Mediafragment.prototype = new IriSP.Widgets.Widget(); |
19 |
19 |
20 IriSP.Widgets.Mediafragment.prototype.draw = function() { |
20 IriSP.Widgets.Mediafragment.prototype.draw = function() { |
21 this.onMediaEvent("pause","setHashToTime"); |
21 this.onMediaEvent("setpause","setHashToTime"); |
22 var _this = this; |
22 var _this = this; |
23 this.getWidgetAnnotations().forEach(function(_annotation) { |
23 this.getWidgetAnnotations().forEach(function(_annotation) { |
24 _annotation.on("click", function() { |
24 _annotation.on("click", function() { |
25 _this.setHashToAnnotation(_annotation.id); |
25 _this.setHashToAnnotation(_annotation.id); |
26 }) |
26 }) |
27 }); |
27 }); |
28 this.player.on("widgets-loaded", function() { |
28 if (this.media.loadedMetadata) { |
29 _this.goToHash(); |
29 this.goToHash(); |
30 }); |
30 } else { |
|
31 this.onMediaEvent("loadedmetadata","goToHash"); |
|
32 } |
31 } |
33 } |
32 |
34 |
33 IriSP.Widgets.Mediafragment.prototype.setWindowHash = function(_hash) { |
35 IriSP.Widgets.Mediafragment.prototype.setWindowHash = function(_hash) { |
34 if (typeof window.history !== "undefined" && typeof window.history.replaceState !== "undefined") { |
36 if (typeof window.history !== "undefined" && typeof window.history.replaceState !== "undefined") { |
35 window.history.replaceState({}, "", _hash); |
37 window.history.replaceState({}, "", _hash); |