Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix progress bar redraw on seek to start position #426

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/js/view/components/controls/progressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ const ProgressBar = function ($container, api, isAd, metadata) {

if (isAd) {
api.on(AD_TIME, function (data) {
if (data && data.duration && data.position) {
if (data && data.duration && typeof data.position === "number") {
Copy link
Contributor Author

@Emzawadzki Emzawadzki May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be a good practice to add the same check also for data.duration, but I guess it doesn't matter when duration is 0.

positionElements(data.position / data.duration);
adDuration = data.duration;
}
}, template);
} else {

api.on(CONTENT_TIME, function (data) {
if (data && data.duration && data.position) {
if (data && data.duration && typeof data.position === "number") {

durationForCalc = data.duration;
let percentage = data.position / data.duration;
Expand Down