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

Ability to Start Playing Stories from a Specific Story Index #113

Closed
Adil7767 opened this issue Sep 3, 2024 · 1 comment
Closed

Ability to Start Playing Stories from a Specific Story Index #113

Adil7767 opened this issue Sep 3, 2024 · 1 comment

Comments

@Adil7767
Copy link
Contributor

Adil7767 commented Sep 3, 2024

I would like to request a feature that allows users to start playing stories from a specific story index. Currently, once you close the stories modal, the playback always begins from the first story. It would be beneficial to have an option where users can select a specific story to start from, especially after they have already watched some stories.

Use Case:

Imagine a user has watched the first 5 stories in the list and then closes the stories modal.
When the user reopens the modal, instead of starting from the beginning, they want to start watching from a specific story, such as the story at index 9.

Feature Request:

Provide an option to allow users to select a specific story from the list of stories.
When a story is selected, the playback should start from that story and continue forward.

@Adil7767
Copy link
Contributor Author

Adil7767 commented Oct 3, 2024

to fix this i have made some changes in package add these changes and update the package
changes are
diff --git a/node_modules/@birdwingo/react-native-instagram-stories/src/components/InstagramStories/index.tsx b/node_modules/@birdwingo/react-native-instagram-stories/src/components/InstagramStories/index.tsx
index ab743de..4a3f991 100644
--- a/node_modules/@birdwingo/react-native-instagram-stories/src/components/InstagramStories/index.tsx
+++ b/node_modules/@birdwingo/react-native-instagram-stories/src/components/InstagramStories/index.tsx
@@ -175,6 +175,7 @@ const InstagramStories = forwardRef<InstagramStoriesPublicMethods, InstagramStor

   },
   clearProgressStorage,
  • ` goToSpecificStory:(userId:string,index:number)=>modalRef.current?.goToSpecificStory(userId,index),`
     hide: () => modalRef.current?.hide(),
     show: ( id ) => {
    

diff --git a/node_modules/@birdwingo/react-native-instagram-stories/src/components/Modal/index.tsx b/node_modules/@birdwingo/react-native-instagram-stories/src/components/Modal/index.tsx
index 873c3b9..aa0b336 100644
--- a/node_modules/@birdwingo/react-native-instagram-stories/src/components/Modal/index.tsx
+++ b/node_modules/@birdwingo/react-native-instagram-stories/src/components/Modal/index.tsx
@@ -117,6 +117,7 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {

};

  • const scrollTo = (
    id: string,
    animated = true,
    @@ -423,6 +424,8 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {
    getCurrentStory: () => ( { userId: userId.value, storyId: currentStory.value } ),
    goToPreviousStory: toPreviousStory,
    goToNextStory: toNextStory,
  • goToSpecificStory:(userId:string,index:number)=>{scrollTo(userId, true, false, undefined, index)},
  • // (userId: string, index: number) => scrollTo(userId, true, false, undefined, index),
    } ), [ userId.value, currentStory.value ] );

useEffect( () => {
@@ -507,3 +510,7 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {
} );

export default memo( StoryModal );
+function scrollTo(id: string, arg1: boolean, arg2: boolean, undefined: undefined, index: number | undefined) {

  • throw new Error('Function not implemented.');
    +}

diff --git a/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/componentsDTO.ts b/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/componentsDTO.ts
index f19479e..f915fb2 100644
--- a/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/componentsDTO.ts
+++ b/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/componentsDTO.ts
@@ -62,6 +62,10 @@ export type StoryModalPublicMethods = {
goToPreviousStory: () => void;
goToNextStory: () => void;
getCurrentStory: () => { userId?: string, storyId?: string };

+  goToSpecificStory:(
+    userId?: string,
+    index?: number,
+  )=>void;

};

export type GestureContext = {
diff --git a/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/instagramStoriesDTO.ts b/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/instagramStoriesDTO.ts
index 7020e4f..5827372 100644
--- a/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/instagramStoriesDTO.ts
+++ b/node_modules/@birdwingo/react-native-instagram-stories/src/core/dto/instagramStoriesDTO.ts
@@ -93,4 +93,8 @@ export type InstagramStoriesPublicMethods = {
goToPreviousStory: () => void;
goToNextStory: () => void;
getCurrentStory: () => { userId?: string, storyId?: string };

+  goToSpecificStory:(
+    userId?: string,
+    index?: number,
+  )=>void;

};
@LukasFridmansky

Adil7767 added a commit to Adil7767/react-native-stories that referenced this issue Oct 3, 2024
Adil7767 added a commit to Adil7767/react-native-stories that referenced this issue Oct 3, 2024
@Adil7767 Adil7767 closed this as completed Oct 8, 2024
@Adil7767 Adil7767 reopened this Oct 8, 2024
@Adil7767 Adil7767 closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant