Skip to content

Commit

Permalink
Added overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Oct 31, 2023
1 parent b50962e commit 05dfc0b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/player/AtomVideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const isTouchEnabled = /android|iPhone|iPad/i.test(navigator.userAgent);
z-index: 2;
font-size: smaller;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
Expand Down Expand Up @@ -472,10 +473,13 @@ export default class AtomVideoPlayer extends AtomControl {
this.updateVolume();
this.currentTimeSpan.textContent = durationText(0, this.duration);
this.updateProgress();
// const { video } = this;
// const { videoWidth, videoHeight } = video;
// const eW = video.offsetWidth * videoHeight / videoWidth;
// this.maxWidth = (100*(this.element.offsetWidth - eW) / this.element.offsetWidth) + "%";
const { video } = this;
const { videoWidth, videoHeight } = video;
const eW = video.offsetWidth * videoHeight / videoWidth;
const maxWidth = (100*(this.element.offsetWidth - eW) / this.element.offsetWidth);
if (maxWidth < 100) {
this.maxWidth = `${maxWidth}%`;
}

AtomBinder.refreshValue(this, "duration");
}}
Expand Down

0 comments on commit 05dfc0b

Please sign in to comment.