Skip to content

Commit

Permalink
fix js exception when disabling smooth playback position updater
Browse files Browse the repository at this point in the history
  • Loading branch information
stonko1994 committed Jan 14, 2025
1 parent e023dc5 commit d35357e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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/).

## [Unreleased]

## Fixed
- Exception when disabling smooth playback position updating by setting `SeekbarConfig.smoothPlaybackPositionUpdateIntervalMs` to `-1`

## [3.82.0] - 2025-01-13

### Added
Expand Down
4 changes: 2 additions & 2 deletions src/ts/components/seekbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ export class SeekBar extends Component<SeekBarConfig> {

uimanager.onControlsShow.subscribe(() => {
this.isUiShown = true;
if (!player.isLive() && !this.smoothPlaybackPositionUpdater.isActive()) {
if (this.smoothPlaybackPositionUpdater && !player.isLive() && !this.smoothPlaybackPositionUpdater.isActive()) {
playbackPositionHandler(null, true);
this.smoothPlaybackPositionUpdater.start();
}
});

uimanager.onControlsHide.subscribe(() => {
this.isUiShown = false;
if (this.smoothPlaybackPositionUpdater.isActive()) {
if (this.smoothPlaybackPositionUpdater && this.smoothPlaybackPositionUpdater.isActive()) {
this.smoothPlaybackPositionUpdater.clear();
}
});
Expand Down

0 comments on commit d35357e

Please sign in to comment.