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

the video doesn't work is i give youtube link as source #308

Open
amirahad opened this issue Mar 27, 2024 · 0 comments
Open

the video doesn't work is i give youtube link as source #308

amirahad opened this issue Mar 27, 2024 · 0 comments

Comments

@amirahad
Copy link

amirahad commented Mar 27, 2024

i tried to give youtube video link as video source but the story keeps loading and doesn't show or play the video. But it works fine if i upload the video on cloud storage like AWS.
here is the code :

<Stories
   stories={Array.isArray(mainStory?.docs[0]?.stories) && mainStory?.docs[0]?.stories.map((story) => {
       return story.type === 'image'
         ? {
                 url: story.image_url,
                 type: 'image',
                 header: {
                     heading: story.topic.title.fr || story.topic.title.en,
                     profileImage: story.topic.image,
                 },
             }
             : {
                    url: story.video_url,
                    type: 'video',
                    header: {
                         heading: story.topic.title.fr || story.topic.title.en,
                         profileImage: story.topic.image,
                    },
                 };
           })}
                 onAllStoriesEnd={
                     () => {
                          if (currentStoryIndex < originalTopics.length - 1) {
                          setFade('fade-out');
                          setLoading(true);
                          setTimeout(() => {
                                setCurrentStoryIndex((prevIndex) => prevIndex + 1);
                                setFade('fade-in');
                                const nextTopicId = originalTopics[currentStoryIndex + 1]?._id;
                                if (nextTopicId) {
                                      getMainStory({ topic: nextTopicId });
                                      setLoading(false);
                                }
                           }, 500);
                           } else if (currentStoryIndex === originalTopics.length - 1) {
                                 router.push('/')
                           }
                        }
                    }
                    height={'100vh'}
                    width={window.innerWidth > 432 ? 432 : window.innerWidth}
                    defaultInterval={20000}
/>

Result:

image

Live site link:
futurx

@amirahad amirahad changed the title the video doesn't wrok is i give youtube link as source the video doesn't work is i give youtube link as source Mar 28, 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