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] Play a clip and stop, preload the next clip. #579

Closed
MattGyverLee opened this issue Feb 27, 2019 · 1 comment
Closed

[Question] Play a clip and stop, preload the next clip. #579

MattGyverLee opened this issue Feb 27, 2019 · 1 comment

Comments

@MattGyverLee
Copy link

MattGyverLee commented Feb 27, 2019

I'm using React-player In an environment where I sometimes have no control over the data structure or ability to re-encode. In some cases, I need to play lots of clips back to back. Sometimes I will need to play a short clips of a local media file.

I see in #152 that you have a "end" feature for youTube, is there a precise way to instruct react to play a local file from, for example, 5.000s to 7.000s and stop, or do I have to watch the OnProgress events and try to catch the next event after my endpoint?

I know that for back-to-back files, there is an onEnded event I can listen for before queuing up the next clip. Is there a way I can preload the next audio clip in a single player, or should I load up a new player and wait for the onEnded?

~Matthew Lee

Update:
As shown here: https://stackoverflow.com/questions/9845565/in-html5-video-how-to-play-a-small-clip-from-a-long-video
Adding "#t=30,45" to the URL allows me to play a clip of a local file.

@cookpete
Copy link
Owner

You would need to render two ReactPlayer instances, one hidden, and use onEnded to hide the current player and immediately show and play the hidden 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

2 participants