rtmp_stream 1.0.0
๐ Overview
rtmp_stream is a Flutter plugin designed to provide unified RTMP streaming and video recording capabilities for Android and iOS.
It addresses the lack of suitable Flutter RTMP plugins on pub.dev: existing plugins are either no longer maintained or rely on outdated dependencies, making them unsuitable for modern mobile applications.
โ๏ธ Technical Foundation
- Android: Based on
com.github.pedroSG94.RootEncoder:library:2.6.6 - iOS: Based on HaishinKit 2.2.2
By leveraging these mature libraries, rtmp_stream provides a consistent cross-platform API interface, reducing development complexity.
โ Why This Plugin
- No suitable Flutter RTMP plugin exists on pub.dev.
- Existing plugins suffer from:
- Long-term lack of maintenance.
- Outdated dependencies, incompatible with the latest Flutter and platform SDKs.
Therefore, the goal of rtmp_stream is to deliver a modern, stable, and maintainable RTMP streaming solution.
๐ ๏ธ Supported Methods
๐ Common Methods (Android & iOS)
- ๐ท Get available cameras:
availableCameras - โ๏ธ Initialize plugin:
initialize - ๐ฅ Start local video recording:
startVideoRecording - โน๏ธ Stop local video recording:
stopRecording - ๐ก Start recording and streaming:
startVideoRecordingAndStreaming - โน๏ธ Stop recording or streaming:
stopRecordingOrStreaming - ๐ก Start video streaming:
startVideoStreaming - โน๏ธ Stop video streaming:
stopStreaming - ๐ Switch camera:
switchCamera - ๐ Toggle audio on/off:
switchAudio - ๐ก Toggle flashlight on/off:
switchFlashLight - ๐ Get stream statistics:
getStreamStatistics - ๐๏ธ Dispose plugin:
dispose
๐ iOS Exclusive Methods
Since HaishinKit supports not only streaming but also RTMP playback, iOS provides additional features:
- โธ๏ธ Pause stream playback:
pauseStreamNote: This pauses playback, not streaming.
- โถ๏ธ Resume stream playback:
resumeStreamNote: This resumes playback, not streaming.
- ๐๏ธ Set audio bitrate:
setAudioSettings - ๐๏ธ Set video settings:
setVideoSettings - ๐ Get temporary mute status:
getHasAudio - ๐ Set temporary mute:
setHasAudio - ๐ฅ Get temporary video stop status:
getHasVideo - ๐ฅ Set temporary video stop:
setHasVideo - ๐ฌ Set streaming frame rate:
setFrameRate - โ๏ธ Set session preset:
setSessionPreset - ๐ผ๏ธ Set screen dimensions:
setScreenSettings
๐ค Android Exclusive Methods
Android provides additional features during live streaming:
- ๐ธ Take snapshot during streaming:
takePicture - โธ๏ธ Pause recording:
pauseVideoRecording - โถ๏ธ Resume recording:
resumeVideoRecording - ๐จ Apply filter:
setFilterFilter
typevalues correspond to filters defined in source code:
CameraNativeView.kt - โ Remove filter:
removeFilter
๐ Conclusion
rtmp_stream 1.0.0 provides Flutter developers with a cross-platform, modern RTMP streaming and video recording plugin, addressing the shortcomings of the current ecosystem.
It is built on Androidโs RootEncoder and iOSโs HaishinKit, offering a unified API while extending playback and audio/video controls on iOS, and snapshot and filter features on Androidโhelping developers quickly build live streaming and recording applications.