Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

It is blank screen in Android... #19

Open
lpylinan opened this issue Oct 11, 2019 · 1 comment
Open

It is blank screen in Android... #19

lpylinan opened this issue Oct 11, 2019 · 1 comment

Comments

@lpylinan
Copy link

Logs:
I/ReactRTMPView: Lifecycle: onHostPause
W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.perrystreetsoftware.RNRtmpViewManager
I/ReactRTMPView: Lifecycle: onHostResume
I/ReactRTMPView: Unable to play; not idle

@somoso
Copy link

somoso commented Aug 3, 2020

For what it's worth, I had this issue, but I didn't follow the example closely enough:

import { RtmpView } from 'react-native-rtmpview';

export default class Example extends Component {
  componentDidMount() {
    // *** This is the key bit!
    this.player.initialize();
    // *** End of key bit!
  }
  
  render() {
    return (
        <RtmpView
          style={styles.player}
          shouldMute={true}
          ref={e => { this.player = e; }}
          onPlaybackState={(data) => {
            this.handlePlaybackState(data);
          }}
          onFirstVideoFrameRendered={(data) => {
            this.handleFirstVideoFrameRendered(data);
          }}
          url="rtmp://localhost:1935/live/stream"
        />
    )
  }
}

Note the componentDidMount() has a this.player.initialize() which is absolutely crucial for initialising all the components properly (and one cannot initialise properly without the ref bit)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants