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

Can't get ReactPlayer to work with redirect urls #86

Closed
vincentchin opened this issue Jul 25, 2016 · 6 comments
Closed

Can't get ReactPlayer to work with redirect urls #86

vincentchin opened this issue Jul 25, 2016 · 6 comments

Comments

@vincentchin
Copy link

I'm not sure how to get ReactPlayer to load a url like https://domain.com/redirects/files/20.

Right now it returns a video tag in FilePlayer but no src is being set. Any ideas how to config this?

@cookpete
Copy link
Owner

This is something I've been thinking about recently, especially with the demand for supporting blob URLs and RTSP URLs. I wonder if ReactPlayer should fall back to FilePlayer if a url is provided that no other player can play. Or perhaps a more explicit solution would be a forcePlayer prop to override the type of player to use, regardless of URL, like so:

import ReactPlayer, { FilePlayer } from 'react-player'

return (
  <ReactPlayer
    url='https://domain.com/redirects/files/20'
    playing={true}
    forcePlayer={FilePlayer}
  />
)

@vincentchin
Copy link
Author

Hmm, would it make more sense to just have ReactPlayer default to FilePlayer and not render any of the other player components unless their config is passed in? Otherwise, I think the idea you suggested is good.

@belohlavek
Copy link

Can we get some implementation of this ASAP? Later on it'd possible to decide which method is more convenient!

Thanks making this component btw 😁

cookpete added a commit that referenced this issue Jul 29, 2016
Fall back to FilePlayer if no other players can play the given URL
Still renders Youtube or Vimeo if the preload config option is set
Fixes #86
@cookpete
Copy link
Owner

I've pushed a possible fix to the fileplayer-default branch, if travis build passes I'll merge it in and publish a new version. Probably should be a minor version update as we lose the static canPlay method (now that any URL can technically be "played").

@cookpete
Copy link
Owner

Fixed in 0.8.0

@SmileHub
Copy link

SmileHub commented Nov 7, 2024

Bringing up, ReactPlayer doesn't seem to follow redirects, for example:
Livestream redirect
https://lb.ims-cdn.net/redirect/live/live_ims_27863_01?type=m3u8

tested with
"react-player": "^2.13.0",

also tested in demo page here:
https://cookpete.com/react-player/

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