@@ -84,20 +84,29 @@ const offset = function(options) {
8484 } ;
8585
8686 Player . prototype . duration = function ( ) {
87- if ( this . _offsetEnd > 0 ) {
88- return this . _offsetEnd - this . _offsetStart ;
87+ if ( this . _offsetEnd !== undefined && this . _offsetStart !== undefined ) {
88+ if ( this . _offsetEnd > 0 ) {
89+ return this . _offsetEnd - this . _offsetStart ;
90+ }
91+ return Player . __super__ . duration . apply ( this , arguments ) - this . _offsetStart ;
8992 }
90- return Player . __super__ . duration . apply ( this , arguments ) - this . _offsetStart ;
93+ return Player . __super__ . duration . apply ( this , arguments ) ;
9194 } ;
9295
9396 Player . prototype . currentTime = function ( seconds ) {
9497 if ( seconds !== undefined ) {
95- return Player . __super__ . currentTime
96- . call ( this , seconds + this . _offsetStart ) ;
98+ if ( this . _offsetStart !== undefined ) {
99+ return Player . __super__ . currentTime
100+ . call ( this , seconds + this . _offsetStart ) ;
101+ }
102+ return Player . __super__ . currentTime . call ( this , seconds ) ;
97103 }
98104
99- return Player . __super__ . currentTime
100- . apply ( this ) - this . _offsetStart ;
105+ if ( this . _offsetStart !== undefined ) {
106+ return Player . __super__ . currentTime
107+ . apply ( this ) - this . _offsetStart ;
108+ }
109+ return Player . __super__ . currentTime . apply ( this ) ;
101110 } ;
102111
103112 Player . prototype . remainingTime = function ( ) {
0 commit comments