Skip to content

Commit

Permalink
Merge pull request #653 from bitmovin/feature/reduce-forced-reflows
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-hoc authored Nov 19, 2024
2 parents 152b3b2 + 930c724 commit 2b8fea5
Show file tree
Hide file tree
Showing 2 changed files with 14 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
- Potential performance impact caused by forced layout reflows

## [3.74.0] - 2024-10-24

### Changed
Expand Down
11 changes: 9 additions & 2 deletions src/ts/components/seekbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,17 @@ export class SeekBar extends Component<SeekBarConfig> {

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

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

let isPlaying = false;
Expand Down Expand Up @@ -323,12 +330,12 @@ export class SeekBar extends Component<SeekBarConfig> {
scrubbing = false;
};

let onPlayerSeeked = (event: PlayerEventBase = null, forceUpdate: boolean = false ) => {
let onPlayerSeeked = (event: PlayerEventBase = null) => {
isPlayerSeeking = false;
this.setSeeking(false);

// update playback position when a seek has finished
playbackPositionHandler(event, forceUpdate);
playbackPositionHandler(event, true);
};

let restorePlayingState = function () {
Expand Down

0 comments on commit 2b8fea5

Please sign in to comment.