Skip to content

Commit

Permalink
fix(UI): Fix "Live" label in some languages (#7560)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Nov 12, 2024
1 parent b8b0776 commit 02b6133
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/seek_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,16 @@ shaka.ui.SeekBar = class extends shaka.ui.RangeElement {
const leftPosition = Math.min(this.bar.offsetWidth - width,
Math.max(0, pixelPosition - (width / 2)));
this.timeContainer_.style.left = leftPosition + 'px';
this.timeContainer_.style.right = '';
this.timeContainer_.style.visibility = 'visible';
const seekRange = this.player.seekRange();
if (this.player.isLive()) {
const totalSeconds = seekRange.end - value;
if (totalSeconds < 1) {
this.timeContainer_.textContent =
this.localization.resolve(shaka.ui.Locales.Ids.LIVE);
this.timeContainer_.style.left = '';
this.timeContainer_.style.right = '0px';
} else {
this.timeContainer_.textContent =
'-' + this.timeFormatter_(totalSeconds);
Expand Down

0 comments on commit 02b6133

Please sign in to comment.