24 |
24 |
25 if ( pageoffset.substring(0, 2) === "t=") { |
25 if ( pageoffset.substring(0, 2) === "t=") { |
26 // timecode |
26 // timecode |
27 if ( pageoffset.substring( 2 ) != null ) { |
27 if ( pageoffset.substring( 2 ) != null ) { |
28 var offsettime = pageoffset.substring( 2 ); |
28 var offsettime = pageoffset.substring( 2 ); |
29 this._Popcorn.currentTime( parseFloat( offsettime ) ); |
29 this._Popcorn.currentTime( parseFloat(offsettime) ); |
|
30 |
|
31 /* we have to trigger this signal manually because of a |
|
32 bug in the jwplayer */ |
|
33 this._Popcorn.trigger("seeked", parseFloat(offsettime)); |
30 } |
34 } |
31 } else if ( pageoffset.substring(0, 3) === "id=") { |
35 } else if ( pageoffset.substring(0, 3) === "id=") { |
32 // annotation |
36 // annotation |
33 var annotationId = pageoffset.substring( 3 ); |
37 var annotationId = pageoffset.substring( 3 ); |
34 // there's no better way than that because |
38 // there's no better way than that because |
35 // of possible race conditions |
39 // of possible race conditions |
36 this._serializer.sync(IriSP.wrap(this, function() { |
40 this._serializer.sync(IriSP.wrap(this, function() { |
37 this.lookupAnnotation.call(this, annotationId); |
41 this.lookupAnnotation.call(this, annotationId); |
38 })); |
42 })); |
39 } |
43 } |
40 } |
44 } |
41 }; |
45 }; |
42 |
46 |
43 /** handler for the seeked signal. It may have or may have not an argument. |
47 /** handler for the seeked signal. It may have or may have not an argument. |
44 @param time if not undefined, the time we're seeking to |
48 @param time if not undefined, the time we're seeking to |
96 } |
100 } |
97 } |
101 } |
98 |
102 |
99 if (typeof(annotation) !== "undefined") { |
103 if (typeof(annotation) !== "undefined") { |
100 this._Popcorn.currentTime(annotation.begin / 1000); |
104 this._Popcorn.currentTime(annotation.begin / 1000); |
|
105 |
|
106 /* we have to trigger this signal manually because of a |
|
107 bug in the jwplayer */ |
|
108 this._Popcorn.trigger("seeked", annotation.begin / 1000); |
101 this._Popcorn.trigger("IriSP.Mediafragment.showAnnotation", annotationId); |
109 this._Popcorn.trigger("IriSP.Mediafragment.showAnnotation", annotationId); |
102 } |
110 } |
103 |
111 |
104 window.setTimeout(function() { _this.mutex = false }, 50); |
112 window.setTimeout(function() { _this.mutex = false }, 50); |
105 }; |
113 }; |