Gauravdarkslayer / ngx-stories

An Angular component to render instagram like stories.
https://ngx-stories.vercel.app
MIT License
1 stars 0 forks source link

💡 [REQUEST] - Pause the story if user changes browser's tab #13

Open Gauravdarkslayer opened 1 week ago

Gauravdarkslayer commented 1 week ago

Start Date

No response

Implementation PR

No response

Reference Issues

No response

Summary

To enhance the user experience when watching stories, we want to implement a feature where the story playback is automatically paused if the user switches to another browser tab or window. This ensures that no part of the story is missed during an inactive state. When the browser tab becomes active again, the story should automatically resume from where it was paused, without requiring manual intervention from the user.

This feature can be implemented by utilizing the visibilitychange event provided by the Page Visibility API. The event detects when the browser tab becomes hidden (indicating a tab switch or window minimization) and triggers actions based on the visibility state.

In this context:

This provides a seamless and intuitive experience for users who navigate away from the tab, ensuring they don’t miss any content while keeping the interaction effortless.

Basic Example

No response

Drawbacks

No response

Unresolved questions

No response