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

FilePlayer does not work if I passed an array of urls #1604

Closed
niktverd opened this issue Mar 29, 2023 · 1 comment · Fixed by #1612
Closed

FilePlayer does not work if I passed an array of urls #1604

niktverd opened this issue Mar 29, 2023 · 1 comment · Fixed by #1612

Comments

@niktverd
Copy link

Be sure to search for your issue before opening a new one.

Current Behavior

Code Sandbox
Player does not load video if I add an array of video
There is src attribute containing undefined

Expected Behavior

Expected to work =)
Probably, problem comes from this PR

Steps to Reproduce

      <ReactPlayer
        url={[
          "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.webm",
          "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/video_8-12_white.mp4"
        ]}
        playing={true}
        width={300}
        height={300}
      />

Environment

Other Information

anampartho added a commit to anampartho/react-player that referenced this issue Apr 13, 2023
…urls

PR cookpete#1538 was setting the src of the video element to undefined. Because
of this, even if the users passed an array of urls, the video element
would not play becuase it got a `src` of `undefined`;

After fixing the undefined `src` issue, another PR was making a infinite
loop issue when user passed an array of urls. There, the author set the
`srcObject` to null. There as well, a check for `url` prop was missing.

This PR aims to fix both of these overlooked aspects.
@anampartho
Copy link
Contributor

@niktverd I have raised a PR for a fix to this issue. You were actually right. This PR was actually the culprit behind the issue. The PR did solve an issue, but for an array of url it was setting the src of the video tag undefined as well. Because of this, the video tag was not able to pick a source and play it.

By fixing that, another issue was remaining, where the video was reloading every second. This was because of another issue where the PR did not take into consideration the array of url.

Before this gets merged or even approved, you can check out the code and see if that has fixed the issue.

cookpete pushed a commit to anampartho/react-player that referenced this issue Aug 31, 2023
…urls

PR cookpete#1538 was setting the src of the video element to undefined. Because
of this, even if the users passed an array of urls, the video element
would not play becuase it got a `src` of `undefined`;

After fixing the undefined `src` issue, another PR was making a infinite
loop issue when user passed an array of urls. There, the author set the
`srcObject` to null. There as well, a check for `url` prop was missing.

This PR aims to fix both of these overlooked aspects.
cookpete pushed a commit that referenced this issue Aug 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
)

PR #1538 was setting the src of the video element to undefined. Because
of this, even if the users passed an array of urls, the video element
would not play becuase it got a `src` of `undefined`;

After fixing the undefined `src` issue, another PR was making a infinite
loop issue when user passed an array of urls. There, the author set the
`srcObject` to null. There as well, a check for `url` prop was missing.

This PR aims to fix both of these overlooked aspects.
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

Successfully merging a pull request may close this issue.

2 participants