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

Start player from specific time #433

Closed
0xmaayan opened this issue Jun 26, 2018 · 10 comments
Closed

Start player from specific time #433

0xmaayan opened this issue Jun 26, 2018 · 10 comments

Comments

@0xmaayan
Copy link

Hey, Great work!

How can I make the player start from a specific time?

Thanks =)

@cookpete
Copy link
Owner

@Msbir what URL type are you trying to play? Each player API has a different config to start at a certain time.

@0xmaayan
Copy link
Author

Thank for the response

I am trying to play youtube type

@cookpete
Copy link
Owner

See #115, although the config example is outdated:

<ReactPlayer
  url='https://youtu.be/qv6UVOQ0F44'
  config={{ 
    youtube: {
      playerVars: {
        start: 33
      }
    }
  }}
/>

@0xmaayan
Copy link
Author

Thank you!

@cookpete
Copy link
Owner

No problem!

@worksintriton
Copy link

how can i write the config for a normal file?

@wuahi
Copy link

wuahi commented Jun 19, 2019

how can i write the config for a normal file?

I am wondering about this too. Tried a couple of ways, for example seeking when onReady, but the player just resets played to zero.

@carmelodiventi
Copy link

for me as well, how I can set a starting time? seeking onStart and onReady will be start from 0 once is loaded

Thanks

@carmelodiventi
Copy link

how can i write the config for a normal file?

I am wondering about this too. Tried a couple of ways, for example seeking when onReady, but the player just resets played to zero.

I've found a solution that may help someone using media fragment

Media Fragments
Adding a media fragment to the media URL, you can specify the exact portion you want to play. To add a media fragment, you simply add #t=[start_time][,end_time] to the media URL

<ReactPlayer
ref={this.ref}
url={${source}#t=${this.state.duration * this.props.played}}
/>

I'm passing played as prop to the player component, that I retrieve from the db stored

@MdMehedi-Hasan
Copy link

hey,
what is the configuration to start the video at a specific time on Vimeo?

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

6 participants