File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -198,11 +198,11 @@ shaka.ui.SeekBar = class extends shaka.ui.RangeElement {
198
198
const min = parseFloat ( this . bar . min ) ;
199
199
const max = parseFloat ( this . bar . max ) ;
200
200
// Pixels from the left of the range element
201
- const mousePosition = event . clientX - rect . left ;
201
+ const mousePosition = Math . max ( 0 , event . clientX - rect . left ) ;
202
202
// Pixels per unit value of the range element.
203
203
const scale = ( max - min ) / rect . width ;
204
204
// Mouse position in units, which may be outside the allowed range.
205
- const value = Math . round ( min + scale * mousePosition ) ;
205
+ const value = Math . min ( max , Math . round ( min + scale * mousePosition ) ) ;
206
206
if ( ! this . player . getImageTracks ( ) . length ) {
207
207
this . hideThumbnail_ ( ) ;
208
208
this . showTime_ ( mousePosition , value ) ;
You can’t perform that action at this time.
0 commit comments