ezranbayantemur / react-native-rtmp-publisher

📹 Live stream RTMP Publisher for React Native
MIT License
98 stars 14 forks source link

stopStream() did not working #51

Open haloriyan opened 3 weeks ago

haloriyan commented 3 weeks ago

Describe the bug

The stopStream method does not successfully stop the live stream. When calling stopStream, the method hangs and eventually times out. The expected logs for stopping the stream are not shown, indicating that the method does not complete its execution.

To Reproduce

Steps to reproduce the behavior:

  1. Set up the RTMP publisher as described in the react-native-rtmp-publisher documentation.
  2. Start a live stream using the startStream method.
  3. Attempt to stop the stream with the following code:
const stopLive = async () => {
  console.log('stopping live...');
  if (publisherRef.current && typeof publisherRef.current.stopStream === 'function') {
    console.log('Attempting to stop the stream...');
    await publisherRef.current.stopStream();
    console.log('live stopped');
  } else {
    console.error('publisherRef is not properly initialized or stopStream method is missing');
  }
}
  1. Observe that "stopping live..." and "Attempting to stop the stream..." are logged, but "live stopped" is not, and a timeout error occurs.

Expected behavior

The stopStream method should successfully stop the live stream, and the log "live stopped" should be printed, indicating that the method completed its execution without hanging or timing out.

Version

^0.4.7

Smartphone info.

Additional context

No response

Screenshots

No response

Relevant log output

No response