video_player_rtmp_ext 0.2.7 copy "video_player_rtmp_ext: ^0.2.7" to clipboard
video_player_rtmp_ext: ^0.2.7 copied to clipboard

A player supporting rtmp&rtmps live video

video_player_rtmp_ext #

pub

A player supporting rtmp,rtmps,m3u8 live video

Your flutter version must be greater than or equal to 3.3.2 to use this plug-in

  • Test Link
  1. http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear2/prog_index.m3u8
  2. rtmp://ns8.indexforce.com/home/mystream
  3. rtmp://mobliestream.c3tv.com:554/live/goodtv.sdp

Getting Started #

video_player_rtmp_ext: ^last_version
Android
  • in project build.gradle add this line
allprojects {
    repositories {
        ...
        maven { url "https://maven.aliyun.com/repository/public" }
    }
}
  • add minSdkVersion set to 19

  • add android:usesCleartextTraffic="true" to you AndroidManifest.xml file

iOS

Update youProject/ios/Podfile

target 'Runner' do
  # update this line 
  use_frameworks! :linkage => :static 
  use_modular_headers!
end
pod install

1.Simple example #

  • Initialize controller
IJKPlayerController controller = IJKPlayerController.network("http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear2/prog_index.m3u8");
  • Using widgets
VideoPlayerRtmpExtWidget(
   controller: controller,
   viewCreated: (IJKPlayerController _){
       controller.play();
   },
)

2. Controller API #

  • Start
controller.play();
  • Pause
controller.pause();
  • Stop
controller.stop();
  • Resume
controller.resume();
  • Judge whether it is playing
final isPlaying = await controller.isPlaying;
  • If you want to play the m3u8 video, please add this line (only android)
if(controller.isAndroid){
   await controller.setPlayManager(PlayerFactory.exo2PlayerManager);
}
  • player state change callback
controller.addListener(onStateChange);
...
void onStateChange(VideoListenerModel model){
  debugPrint("$model");
  model.when(progress: (progress, secProgress, currentPosition, duration) {
  // todo : Playback progress
  }, playbackState: (playbackState) {
  // todo: Playback state
  }, onPlayError: (error) {
  // todo : error callback detail info
  },);
}

Android release proguard-rules.txt #

-keep class com.shuyu.gsyvideoplayer.video.** { *; }
-dontwarn com.shuyu.gsyvideoplayer.video.**
-keep class com.shuyu.gsyvideoplayer.video.base.** { *; }
-dontwarn com.shuyu.gsyvideoplayer.video.base.**
-keep class com.shuyu.gsyvideoplayer.utils.** { *; }
-dontwarn com.shuyu.gsyvideoplayer.utils.**
-keep class com.shuyu.gsyvideoplayer.player.** {*;}
-dontwarn com.shuyu.gsyvideoplayer.player.**
-keep class tv.danmaku.ijk.** { *; }
-dontwarn tv.danmaku.ijk.**
-keep class androidx.media3.** {*;}
-keep interface androidx.media3.**

-keep class com.shuyu.alipay.** {*;}
-keep interface com.shuyu.alipay.**

-keep public class * extends android.view.View{
    *** get*();
    void set*(***);
    public <init>(android.content.Context);
    public <init>(android.content.Context, java.lang.Boolean);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keep class com.alivc.**{*;}
-keep class com.aliyun.**{*;}
-keep class com.cicada.**{*;}
-dontwarn com.alivc.**
-dontwarn com.aliyun.**
-dontwarn com.cicada.**

# Keep Flutter plugin classes
-keep class shop.itbug.video_player_rtmp_ext.VideoPlayerRtmpExtPlugin { *; }
-keep class shop.itbug.video_player_rtmp_ext.ViewFactory { *; }

# Keep all Flutter plugin classes in the package
-keep class shop.itbug.video_player_rtmp_ext.** { *; }

# Suppress warnings for missing classes
-dontwarn shop.itbug.video_player_rtmp_ext.VideoPlayerRtmpExtPlugin

# Suppress warnings for StringConcatFactory used by Kotlin
-dontwarn java.lang.invoke.StringConcatFactory

9
likes
130
points
664
downloads

Publisher

verified publisheritbug.shop

Weekly Downloads

A player supporting rtmp&rtmps live video

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, freezed_annotation, json_annotation, plugin_platform_interface

More

Packages that depend on video_player_rtmp_ext