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

feat(FEC-11979): add setCurrentTime middleware #641

Merged
merged 9 commits into from
Mar 1, 2022
Merged

feat(FEC-11979): add setCurrentTime middleware #641

merged 9 commits into from
Mar 1, 2022

Conversation

yairans
Copy link
Contributor

@yairans yairans commented Feb 23, 2022

Description of the Changes

add setCurrentTime middleware
add support for middleware params chaining

Solves FEC-11979

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

@yairans yairans requested a review from a team February 23, 2022 09:37
@yairans yairans self-assigned this Feb 23, 2022
RoyBregman
RoyBregman previously approved these changes Feb 23, 2022
Copy link
Contributor

@RoyBregman RoyBregman left a comment

Choose a reason for hiding this comment

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

LGTM, I suggest @semarche-kaltura will use this PR locally and check if it works perfect for us before merging

src/middleware/middleware.js Outdated Show resolved Hide resolved
_setCurrentTime(to: number): void {
if (this._engine) {
if (Utils.Number.isNumber(to)) {
let boundedTo = to;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let boundedTo = to;
const boundedTo = to < 0 ? 0 : boundedTo;

if (boundedTo > safeDuration) {
boundedTo = safeDuration;
}
this._engine.currentTime = boundedTo;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
this._engine.currentTime = boundedTo;
this._engine.currentTime = Math.min(boundedTo, safeDuration);

src/player.js Outdated Show resolved Hide resolved
src/middleware/middleware.js Outdated Show resolved Hide resolved
@yairans yairans merged commit 366e381 into master Mar 1, 2022
@yairans yairans deleted the FEC-11979 branch March 1, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants