Skip to content

Commit

Permalink
increase the rewind delay to 100ms (ampproject#38591)
Browse files Browse the repository at this point in the history
* increase the rewind delay to 100ms

Some devices, specifically iphone 12 and up are still having the video
glitching issue with the 10ms delay. Bumping it up to 100ms seems to fix
the issue.

* add TODO and github issue link
  • Loading branch information
erwinmombay authored Dec 20, 2022
1 parent 6754eb8 commit 0daa515
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/amp-story/1.0/media-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,9 @@ export class MediaPool {
return this.enqueueMediaElementTask_(poolMediaEl, new PauseTask()).then(
() => {
if (rewindToBeginning) {
// We add a 10 second delay to rewinding as sometimes this causes an
// TODO: https://github.com/ampproject/amphtml/issues/38595 implement
// proper fix to frame management.
// We add a 100 second delay to rewinding as sometimes this causes an
// interlacing/glitch/frame jump when a new video is starting to play.
// A 0 delay isn't enough as we need to push the "seeking" event
// to the next tick of the event loop.
Expand All @@ -819,7 +821,7 @@ export class MediaPool {
/** @type {!PoolBoundElementDef} */ (poolMediaEl),
new SetCurrentTimeTask({currentTime: 0})
);
}, 10);
}, 100);
}
}
);
Expand Down

0 comments on commit 0daa515

Please sign in to comment.