From 0daa515ff1e284cb2e31dc8fda7f29c073e60b60 Mon Sep 17 00:00:00 2001 From: erwin mombay Date: Tue, 20 Dec 2022 11:23:09 -0800 Subject: [PATCH] increase the rewind delay to 100ms (#38591) * 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 --- extensions/amp-story/1.0/media-pool.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/amp-story/1.0/media-pool.js b/extensions/amp-story/1.0/media-pool.js index 3f7dc606bac6..5504efc028ff 100644 --- a/extensions/amp-story/1.0/media-pool.js +++ b/extensions/amp-story/1.0/media-pool.js @@ -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. @@ -819,7 +821,7 @@ export class MediaPool { /** @type {!PoolBoundElementDef} */ (poolMediaEl), new SetCurrentTimeTask({currentTime: 0}) ); - }, 10); + }, 100); } } );