Previously when an AMP story's visibility goes from inactive to visible the progress of the current page was reset. Currently, this only happens when auto advance is based on a video and not when based on a timer.
In the case of a viewer that shows multiple stories with autoplay, if you let the last page of a story complete its auto advance timer, let the viewer to advance you the next story, and then try to tap or swipe back to the previous story, the previous story will already be at the end and will automatically advance you to the next story instead of replay the final page.
It would be nice if it was possible for the viewer to tell the story to switch to or restart a specific page, but I assume that is coming in the future.
All mobile devices and desktop browsers in mobile dev mode.
Seen in Version 2001251659540, started within the last 3 months.
/cc @ampproject/wg-stories
cc @ampproject/wg-stories
Thanks for filing!
A few thoughts:
visibilityState, or the tab/browser became inactivevisibilityState (but the tab is still active) it is likely because the user is swiping. When/if the user comes back, we want to rewind the page (either video or timing). However, rewinding the video will completely change the content visible on the page, so we need to make sure that viewers change the visibilityState only once the story is off screen@newmuis wdyt?
From the viewer perspective, I would expect these two functionalities to be handled by the two separate paused and inactive visibility states.
paused, which pauses the playbackinactive, which resets the current page's playback and triggers a redrawvisible, which resumes playback from the start of the pagepaused at the start of the swipe, then set it to visible after, making the story resume from where it left off instead of starting the page overThis is the functionality that happened a little while ago. Is the expected behavour from switching tabs different, or can it be handled from the same paused/inactive usage?
All your bullet points sound good to me. :)
I checked with the Google Search teams, and this is how the current Search viewer is implemented, so we should be good.
Is the expected behavour from switching tabs different
Do you mean browser tabs?
If yes, we want to pause the story but we can detect that through this API, and not rewind the last page:
We prioritized https://github.com/ampproject/amphtml/issues/28650 that should fix this issue.
Most helpful comment
From the viewer perspective, I would expect these two functionalities to be handled by the two separate
pausedandinactivevisibility states.paused, which pauses the playbackinactive, which resets the current page's playback and triggers a redrawvisible, which resumes playback from the start of the pagepausedat the start of the swipe, then set it tovisibleafter, making the story resume from where it left off instead of starting the page overThis is the functionality that happened a little while ago. Is the expected behavour from switching tabs different, or can it be handled from the same paused/inactive usage?