Android: Media device stream not released
See original GitHub issueTrying to dispose of the local media stream doesn’t seem to work correctly. I am calling:
localStream.getTracks().forEach(t => t.stop());
localStream.release();
But signs are pointing to it still being used.
- I can see camera related logging (
org.webrtc.Logging: CameraStatistics: Camera fps: 30
) continuing on my main device (Nexus 5X, Android 7.1.1) and similar behaviour on another device (Samsung Tablet, Android 5.1.1). - Device continues to feel hot.
- Battery stats show the usage for the app continues to use the camera.
I think https://github.com/oney/react-native-webrtc/issues/101 might be related to this.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Android Media Player Streaming not working - Stack Overflow
I have created one streaming audio application which is working on some Android devices but except moto g (6.0. 1)API. Code: URL url...
Read more >Fix problems with videos in your library - Google TV Help
Fix problems with videos in your library · Clear the app's cache · Check for app updates · Restart your phone or tablet...
Read more >MediaPlayer - Android Developers
MediaPlayer class can be used to control playback of audio/video files and streams. MediaPlayer is not thread-safe. Creation of and all access to...
Read more >MediaDevices.getUserMedia() - Web APIs | MDN
It returns a Promise that resolves to a MediaStream object. If the user denies permission, or matching media is not available, then the...
Read more >NVIDIA SHIELD Android TV Pro Streaming Media Player; 4K ...
Amazon.com: NVIDIA SHIELD Android TV Pro Streaming Media Player; 4K HDR movies, ... Available at a lower price from other sellers that may...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@maximovicd I have managed to reproduce your solution.
stopCapture
only exists onVideoCapturerAndroid
so theVideoCapturer
instance needs to be cast back.@zxcpoiu This is the
VideoCapturer
reference that needs to be kept and havestopCapture
called on. https://github.com/oney/react-native-webrtc/blob/master/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java#L323It also seems to fix https://github.com/oney/react-native-webrtc/issues/101 for me.
I will try and find the time to get a PR together. I need to get a better understanding of
WebRTCModule.java
and whenstopCapture
should be called first.I’ll have the time to look into this issue next week.