Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

577
Views
How to trigger stop method for react-player to stop and end video?

How to trigger stop method for react-player to stop and end video? Here is my code:

<ReactPlayer
  className="react-player mw-100 w-100 "
  id="myPlayer"
  ref={(player) => {
    this.player = player;
  }}
  url={VIMEO_URL}
  onStart={() => {
    this.player.seekTo(this.getProgress());
  }}
  onPlay={() => this.play(this)}
  onPause={() => this.pause()}
  onDuration={this.handleDuration}
  onProgress={this._recordProgress}
  onReady={() => this.player.seekTo(this.getProgress())}
/>;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try using the playing proerty:

const [isPlaying, setIsPlaying] = useState(true);

<ReactPlayer
  playing={isPlaying}
  className="react-player mw-100 w-100 "
  id="myPlayer"
  ref={(player) => {
    this.player = player;
  }}
  url={VIMEO_URL}
  onStart={() => {
    this.player.seekTo(this.getProgress());
  }}
  onPlay={() => this.play(this)}
  onPause={() => this.pause()}
  onDuration={this.handleDuration}
  onProgress={this._recordProgress}
  onReady={() => this.player.seekTo(this.getProgress())}
/>;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!