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

Question: Is there a way to add few html5 source tags? #81

Closed
antongorodezkiy opened this issue Jul 12, 2016 · 4 comments
Closed

Question: Is there a way to add few html5 source tags? #81

antongorodezkiy opened this issue Jul 12, 2016 · 4 comments

Comments

@antongorodezkiy
Copy link

Hello @cookpete

Thanks for the nice lib!

Is there a way to add few html5 source tags or the only option is to use url prop for single source?

@cookpete
Copy link
Owner

Currently only a single src is supported, however it would be good to support multiple source tags, so I'll leave this open.

How would it work? Perhaps ReactPlayer could have child nodes that are added to video and only rendered when playing is true? Something like:

<ReactPlayer playing={true}>
  <source src='foo.webm' type='video/webm'>
  <source src='foo.ogg' type='video/ogg'> 
  <source src='foo.mov' type='video/quicktime'>
</ReactPlayer>

The trouble is that the children would exist for all the players, but only be used in FilePlayer which is a little strange. If we don't require a type we could take an array of sources in the url prop:

<ReactPlayer
  playing={true}
  url={['foo.webm', 'foo.ogg']}
/>

Or if we still want to specify a type we could take an array of objects:

<ReactPlayer
  playing={true}
  url={[
    {src: 'foo.webm', type: 'video/webm'},
    {src: 'foo.ogg', type: 'video/ogg'}
  ]}
/>

@willbowling
Copy link

This would be awesome. Any movement on this?

cookpete added a commit that referenced this issue Feb 14, 2017
@cookpete
Copy link
Owner

I've pushed a possible fix for this to the multiple-sources branch. Feel free to try it out.

@briansayles
Copy link

Would love to see that multiple-sources branch get pulled in to the master.

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
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

4 participants