Skip to content

Commit

Permalink
Merge pull request #585 from bitmovin/feature/fix-exception-when-load…
Browse files Browse the repository at this point in the history
…ing-a-new-source-while-scrubbing

Fix an exception when receiving a `SourceLoaded` event during scrubbing.
  • Loading branch information
stonko1994 authored Nov 13, 2023
2 parents ba2982b + 556ff7a commit 8eaebcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [development]

### Fixed
- Crash when receiving a `SourceLoaded` event during scrubbing

## [3.52.0] - 2023-09-25

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/ts/components/seekbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export class SeekBar extends Component<SeekBarConfig> {
// At the same time when the user is scrubbing, we also move the position of the seekbar to display a preview during scrubbing.
// When the user is scrubbing we do not record this as a user seek operation, as the user has yet to finish their seek,
// but we should not move the playback position to not create a jumping behaviour.
if (scrubbing && event.type === player.exports.PlayerEvent.SegmentRequestFinished && playbackPositionPercentage !== this.playbackPositionPercentage) {
if (scrubbing && event && event.type === player.exports.PlayerEvent.SegmentRequestFinished && playbackPositionPercentage !== this.playbackPositionPercentage) {
playbackPositionPercentage = this.playbackPositionPercentage;
}

Expand Down

0 comments on commit 8eaebcc

Please sign in to comment.