question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onBuffer callback not working with HLS

See original GitHub issue

i’m trying to use onBuffer to show a loading spinner while the video buffers, however the callback is never fired. the following is my component call

         <ReactPlayer
            ref={this.ref}
            style={style}
            url={this.props.url}
            width={'100%'}
            height={'100%'}
            playing={this.state.playing}
            onDuration={(i) => this.onDurationHandler(i)}
            onProgress={(i) => this.onProgressHandler(i)}
            onBuffer={() => this.onBufferHandler()}
            onPlay={() => this.onPlayHander()}
          />

then higher up in my component i have the following:

          onBufferHandler() {
            console.log('onBufferHandler');
            this.setState({isBuffering: true});
          }

this occurs when trying to play an hls file. the file plays fine, and the other callbacks appear to work the way i expect. is this something i need to do by exposing the hls.js player?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
superbuggycommented, Aug 16, 2018

I’m experiencing this, too. Should it be defined in src/Player.js?

0reactions
srameshrcommented, Feb 3, 2019

Anything on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

onBuffer callback not working with HLS · Issue #466 - GitHub
i'm trying to use onBuffer to show a loading spinner while the video buffers, however the callback is never fired. the following is...
Read more >
react-native-video video on demand dash or hls streaming ...
I make downgrade to version 4.4.4. It worked for me. Code example: <Video onError={this.onError} onBuffer={this.onBuffer} onProgress={this.
Read more >
Developers - onBuffer doesn't work as expected anymore -
onBuffer doesn't work as expected anymore. ... The onBuffer callback is always true after upgrading to version 5. It never returns false even...
Read more >
ReactPlayer - Best of JS
ReactPlayer v2.0 changes single player imports and adds lazy loading players. ... Callback props take a function that gets fired on various player...
Read more >
react-native-video - npm
Start using react-native-video in your project by running `npm i ... onBuffer} // Callback when remote video is buffering onError={this.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found