Flutter Radio Player, A Plugin to handle streaming audio without a hassle

Overview

logo

likes popularity pub points

Flutter radio plugin handles a single streaming media preciously. This plugin was developed with maximum usage in mind. Flutter Radio player enables Streaming audio content on both Android and iOS natively, as an added feature this plugin supports background music play as well. This plugin also integrate deeply with both core media capabilities such as MediaSession on Android and RemoteControl capabilities (Control Center) on iOS. This plugin also support controlling the player via both wearOS and WatchOS.

Features

  • Supports both android and ios
  • Supports background music playing
  • Integrates well with watchOS and WearOS.
  • Handles network interruptions.
  • Reactive
  • Developer friendly (Logs are placed though out the codebase, so it's easy to trace a bug)

Reactivity ?

Unlike any other Music Playing plugin Flutter Radio Player is very reactive. It communicates with the native layer using Event and Streams, this making the plugin very reactive to both Application (Flutter) side and the native side.

Plugin events

This plugin utilises Android LocalBroadcaster and iOS Notification center for pushing out events. Names of the events are listed below.

  • flutter_radio_playing
  • flutter_radio_paused
  • flutter_radio_stopped
  • flutter_radio_error
  • flutter_radio_loading

Getting Started

  1. Add this to your package's pubspec.yaml file
dependencies:
  flutter_radio_player: ^1.X.X
  1. Install it
$ flutter pub get
  1. Import it
import 'package:flutter_radio_player/flutter_radio_player.dart';
  1. Configure it Creat a new instance of the player. An FlutterRadioPlayer instance can play a single audio stream at a time. To create it, simply call the constructor. However DO NOT make multiple instances of the service as FRP is using a FOREGROUND SERVICE to keep itself live when you minimize the application in Android.
FlutterRadioPlayer _flutterRadioPlayer = new FlutterRadioPlayer();

When you have an FRP instance you may simply call the init method to invoke the platform specific player preparation. For the API please reffer FRP API.

await _flutterRadioPlayer.init("Flutter Radio Example", "Live", "URL_HERE", "true");

After player preparation you may simply call playOrPause method to toggle audio stream.

await _flutterRadioPlayer.playOrPause();

FRP does allow you to change the URL after player initialized. You can simply change the stream url by calling setUrl on FRP object.

await _flutterRadioPlayer.setUrl('URL_HERE', "false");

calling above method will cause the existing URL to pause and play the newly set URL. Please refer the FRP API for api documentation.

Besides above mentioned method, below are the methods that FRP exposes.

  • stop() - Will stop all the streaming audio streams and detaches itself from FOREGROUND SERVICE. You need to reinitialize to use the plugin again,
await _flutterRadioPlayer.stop()
  • start() - Will start the audio stream using the initialized object.
await _flutterRadioPlayer.start()
  • pause() - Will pause the audio stream using the initialized object.
await _flutterRadioPlayer.pause()

Now that's not all. This plugin handles almost everything for you when it comes to playing a single stream of audio. From Player meta details to network interruptions, FRP handles it all with a sweat. Please refer the example to get an idea about what FRP can do.

iOS and Android Support

If the plugin is failing to initiate, kindly make sure your permission for background processes are given for your application

For your Android application you might want to add permissions in AndroidManifest.xml. This is already added for in the library level.

    <!--  Permissions for the plugin  -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <!--  Services for the plugin  -->
    <application android:usesCleartextTraffic="true">
        <service android:name=".core.StreamingCore"/>
    </application>

For your iOS application you need to enable it like this

xcode image

Support

Please hit a like to plugin on pub if you used it and love it. put a ⭐️ my GitHub repo and show me some ♥️ so i can keep working on this.

Found a bug ?

Please feel free to throw in a pull request. Any support is warmly welcome.

Comments
  •  Type mismatch: inferred type is AudioFocusRequest? but AudioFocusRequest was expected

    Type mismatch: inferred type is AudioFocusRequest? but AudioFocusRequest was expected

    .pub-cache\hosted\pub.dartlang.org\flutter_radio_player-1.1.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (188, 46): Type mismatch: inferred type is AudioFocusRequest? but AudioFocusRequest was expected

    opened by StripedMittens 14
  • Android building problem

    Android building problem

    Hi, thank you for your work. I'm trying to use the library on Android but i'm getting error on building phase:

    **e: /Users/acetovi/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.7/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (121, 90): Type mismatch: inferred type is String? but String was expected e: /Users/acetovi/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.7/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (123, 63): Type mismatch: inferred type is String? but String was expected e: /Users/acetovi/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.7/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (174, 32): Type mismatch: inferred type is String? but String was expected

    FAILURE: Build failed with an exception.**

    On IOS device no problems.

    Can you help me with this? Thanks

    opened by vinzaceto 14
  • Getting issue when run in IOS Simulator

    Getting issue when run in IOS Simulator

    Its perfectly working in Android device

    I am adding issue below with complete description.

    Notification received with event name: flutter_radio_playing Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/macbook/Documents/FlutterSetup/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.4/ios/Classes/SwiftFlutterRadioPlayerPlugin.swift, line 100 2020-05-14 16:23:16.608359+0530 Runner[48848:409859] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/macbook/Documents/FlutterSetup/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.4/ios/Classes/SwiftFlutterRadioPlayerPlugin.swift, line 100

    opened by maxbhoria 9
  • Fail running on Android Simulator and Device.  Run on IOS OK no issue

    Fail running on Android Simulator and Device. Run on IOS OK no issue

    Try testing the example. OK on IOS simulator and device BUT FAIL on Android Simulator and Device. See errors below; Restarted application in 1,312ms. I/javaClass(31009): Calling to method: initService I/javaClass(31009): start service invoked I/javaClass(31009): Attempting to initialize service... I/javaClass(31009): Service not bound, binding now.... I/javaClass(31009): Mapping method call to player item object I/flutter (31009): object data: flutter_radio_paused I/flutter (31009): object data: flutter_radio_paused I/flutter (31009): 360.0 V/AudioManager(31009): querySoundEffectsEnabled... I/flutter (31009): button press data: flutter_radio_paused I/flutter (31009): Invoking platform method: playOrPause I/javaClass(31009): Calling to method: playOrPause I/javaClass(31009): Attempting to either play or pause... I/javaClass(31009): Attempting to get playing status.... E/MethodChannel#flutter_radio_player(31009): Failed to handle method call E/MethodChannel#flutter_radio_player(31009): kotlin.UninitializedPropertyAccessException: lateinit property coreService has not been initialized E/MethodChannel#flutter_radio_player(31009): at me.sithiramunasinghe.flutter.flutter_radio_player.FlutterRadioPlayerPlugin.isPlaying(FlutterRadioPlayerPlugin.kt:192) E/MethodChannel#flutter_radio_player(31009): at me.sithiramunasinghe.flutter.flutter_radio_player.FlutterRadioPlayerPlugin.playOrPause(FlutterRadioPlayerPlugin.kt:199) E/MethodChannel#flutter_radio_player(31009): at me.sithiramunasinghe.flutter.flutter_radio_player.FlutterRadioPlayerPlugin.onMethodCall(FlutterRadioPlayerPlugin.kt:64) E/MethodChannel#flutter_radio_player(31009): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) E/MethodChannel#flutter_radio_player(31009): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#flutter_radio_player(31009): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738) E/MethodChannel#flutter_radio_player(31009): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#flutter_radio_player(31009): at android.os.MessageQueue.next(MessageQueue.java:363) E/MethodChannel#flutter_radio_player(31009): at android.os.Looper.loop(Looper.java:176) E/MethodChannel#flutter_radio_player(31009): at android.app.ActivityThread.main(ActivityThread.java:8347) E/MethodChannel#flutter_radio_player(31009): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#flutter_radio_player(31009): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) E/MethodChannel#flutter_radio_player(31009): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055) E/flutter (31009): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(error, lateinit property coreService has not been initialized, null, kotlin.UninitializedPropertyAccessException: lateinit property coreService has not been initialized E/flutter (31009): at me.sithiramunasinghe.flutter.flutter_radio_player.FlutterRadioPlayerPlugin.isPlaying(FlutterRadioPlayerPlugin.kt:192) E/flutter (31009): at me.sithiramunasinghe.flutter.flutter_radio_player.FlutterRadioPlayerPlugin.playOrPause(FlutterRadioPlayerPlugin.kt:199) E/flutter (31009): at me.sithiramunasinghe.flutter.flutter_radio_player.FlutterRadioPlayerPlugin.onMethodCall(FlutterRadioPlayerPlugin.kt:64) E/flutter (31009): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) E/flutter (31009): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/flutter (31009): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:738) E/flutter (31009): at android.os.MessageQueue.nativePollOnce(Native Method) E/flutter (31009): at android.os.MessageQueue.next(MessageQueue.java:363) E/flutter (31009): at android.os.Looper.loop(Looper.java:176) E/flutter (31009): at android.app.ActivityThread.main(ActivityThread.java:8347) E/flutter (31009): at java.lang.reflect.Method.invoke(Native Method) E/flutter (31009): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) E/flutter (31009): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055) E/flutter (31009): ) E/flutter (31009): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7) E/flutter (31009): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18) E/flutter (31009): E/flutter (31009): #2 FlutterRadioPlayer.playOrPause (package:flutter_radio_player/flutter_radio_player.dart:45:12) E/flutter (31009): E/flutter (31009): #3 _MyAppState.build.. (package:flutter_radio_player_example/main.dart:91:37) E/flutter (31009): E/flutter (31009): I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 I/flutter (31009): 360.0 D/DecorView(31009): showOrHideHighlightView: hasFocus=false; winMode=1; isMrgNull=true D/RtgSched(31009): resetRtgSchedHandle failed enable:0 W/libEGL (31009): EGLNativeWindowType 0x79bcdfd010 disconnect failed W/libEGL (31009): EGLNativeWindowType 0x7a1be5abd0 disconnect failed D/ActivityThread(31009): Remove activity client record, r= ActivityRecord{a12562e token=android.os.BinderProxy@d0e3985 {me.sithiramunasinghe.flutter.flutter_radio_player_example/me.sithiramunasinghe.flutter.flutter_radio_player_example.MainActivity}} token= android.os.BinderProxy@d0e3985 D/ZrHung.AppEyeUiProbe(31009): not watching, wait.

    opened by azaman2204 7
  • Metadata Track get artist, song etc. in different Text Widgets

    Metadata Track get artist, song etc. in different Text Widgets

    Hello, in your example I saw that your package makes it possible to get the current Artist and Song but both things are displayed in one TextWidget with snapshot.data.

    Is it possible to show Artist and Song in different Text Widgets?

    Do your package also provides the ability to show the album cover or the album name or the song length?

    opened by enviro-apps 6
  • Bug: Play/pause button first start

    Bug: Play/pause button first start

    Only at the first start of the radio, the status of the button is play but should be paused. Music is playing and show play button.

    After press on play button the status of the button get correct.

    Tested with: ios iphone X 13.3.1

    bug 
    opened by sarp86 6
  • Error Kotlin

    Error Kotlin

    Hello, how are you? I am interested in using the flutter_radio_player, I am using the Android studio to run the example code, but this is giving an error, I have already researched the solution for this error and so far I have not found it. Do you have any suggestions to resolve this error below I thank you for your help Samuel flutter_radio_player.txt

    • What went wrong: Execution failed for task ':flutter_radio_player:compileDebugKotlin'.

    Compilation error. See log for more details

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 23s Finished with error: Gradle task assembleDebug failed with exit code 1

    opened by comerciosite 6
  • Does not change station

    Does not change station

    So we are trying to add the ability to change stations however it is not working.

    
      Future<void> changestation() async{
        try {
         // await _flutterRadioPlayer.stop();
          await _flutterRadioPlayer.setUrl('http://stream.radiomedia.com.au:8015/stream', "false");
        } on PlatformException {
          print("Exception occurred while trying to register the services.");
        }
    //    await _flutterRadioPlayer.play();
      }
    
    
    Full code
    

    import 'package:flutter/material.dart'; import 'dart:async'; import 'package:flutter/services.dart'; import 'package:flutter_radio_player/flutter_radio_player.dart'; import './screens/trackswidget.dart'; import 'about_widget.dart';

    class Home extends StatefulWidget { var playerState = FlutterRadioPlayer.flutter_radio_paused;

    var volume = 0.8;

    @override State createState() { return _HomeState(); } }

    class _HomeState extends State {

    bool check = true; int _currentIndex = 0; FlutterRadioPlayer _flutterRadioPlayer = new FlutterRadioPlayer();

    @override void initState() { super.initState(); initRadioService(); }

    Future initRadioService() async { try { await _flutterRadioPlayer.init( "DRN1", "Live", "http://stream.radiomedia.com.au:8003/stream", "false"); } on PlatformException { print("Exception occurred while trying to register the services."); } //await _flutterRadioPlayer.play(); }

    Future changestation() async{ try { // await _flutterRadioPlayer.stop(); await _flutterRadioPlayer.setUrl('http://stream.radiomedia.com.au:8015/stream', "false"); } on PlatformException { print("Exception occurred while trying to register the services."); } // await _flutterRadioPlayer.play(); }

    final List _children = [TracksWidget(), AboutWidget()];

    @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: Colors.black, title: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ const Text('DRN',style: TextStyle(color: Colors.white, fontSize: 40.0),), const Text('1', style: TextStyle(color: Colors.red, fontSize: 40.0),) ], ), ), //body: _children[_currentIndex], body: Row( children: [ Expanded( child: new RaisedButton( padding: const EdgeInsets.all(8.0), textColor: Colors.white, color: Colors.blue, onPressed: () async { await changestation(); },

              child: new Text("Change Station"),
            ),
          ),
          Expanded(
            child: Text('Craft beautiful UIs', textAlign: TextAlign.center),
          ),
          Expanded(
            child: FittedBox(
              fit: BoxFit.contain, // otherwise the logo will be tiny
              child: const FlutterLogo(),
            ),
          ),
        ],
      ),
    

    /* body: Center( child: Column( children: [ StreamBuilder( stream: _flutterRadioPlayer.isPlayingStream, initialData: widget.playerState, builder: (BuildContext context, AsyncSnapshot snapshot) { String returnData = snapshot.data; print("object data: " + returnData); switch (returnData) { case FlutterRadioPlayer.flutter_radio_stopped: return RaisedButton( child: Text("Start listening now"), onPressed: () async { await initRadioService(); }); break; case FlutterRadioPlayer.flutter_radio_loading: return Text("Loading stream..."); case FlutterRadioPlayer.flutter_radio_error: return RaisedButton( child: Text("Retry ?"), onPressed: () async { await initRadioService(); }); break; default: return Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ IconButton( onPressed: () async { print("button press data: " + snapshot.data.toString()); await _flutterRadioPlayer.playOrPause(); }, icon: snapshot.data == FlutterRadioPlayer .flutter_radio_playing ? Icon(Icons.pause) : Icon(Icons.play_arrow)), IconButton( onPressed: () async { await _flutterRadioPlayer.stop(); }, icon: Icon(Icons.stop)) ]); break; } }), Slider( value: widget.volume, min: 0, max: 1.0, onChanged: (value) => setState(() { widget.volume = value; _flutterRadioPlayer.setVolume(widget.volume); })), Text("Volume: " + (widget.volume * 100).toStringAsFixed(0)) ], ), ), */

      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      floatingActionButton: Container(
        height: 80.0,
        width: 80.0,
        child: FittedBox(
          child:FloatingActionButton(
                  onPressed: () => {
                    setState((){
                      if(check)
                      {
                        check = false;
                         _flutterRadioPlayer.play();
                        print("false");
                      }
                      else
                      {
                        check = true;
                         _flutterRadioPlayer.pause();
                        print("true");
                      }
    
                    }),
                    },
         child: Icon(check ? Icons.play_arrow: Icons.pause),
                backgroundColor: Colors.black,
                mini: true,
              ),
        ),
    
      ),
      bottomNavigationBar: BottomAppBar(
        shape: CircularNotchedRectangle(),
        child: Container(
          decoration:
          new BoxDecoration(color: new Color(0xFFFF0000)),
          height: 75,
          child: Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              IconButton(
                iconSize: 30.0,
                padding: EdgeInsets.only(left: 28.0),
                icon: Icon(Icons.home),
                onPressed: () {
                  setState(() {
    
                    onTabTapped(0);
                  });
                },
              ),
          /*    IconButton(
                iconSize: 30.0,
                padding: EdgeInsets.only(right: 28.0),
                icon: Icon(Icons.search),
                onPressed: () {
                  setState(() {
                    onTabTapped(1);
                  });
                },
              ),
              IconButton(
                iconSize: 30.0,
                padding: EdgeInsets.only(left: 28.0),
                icon: Icon(Icons.notifications),
                onPressed: () {
                  setState(() {
                    onTabTapped(2);
                  });
                },
              ),*/
              IconButton(
                iconSize: 30.0,
                padding: EdgeInsets.only(right: 28.0),
                icon: Icon(Icons.info_outline),
                onPressed: () {
                  setState(() {
                    onTabTapped(1);
                  });
                },
              )
            ],
          ),
        ),
      ),// new
    
    );
    

    }

    void onTabTapped(int index) { setState(() { _currentIndex = index; }); } }

    bug 
    opened by redimongo 5
  • PendingIntent Flag missing in Android > 31

    PendingIntent Flag missing in Android > 31

    In Android 31 i'm getting an error, that the PendingIntent needs a flag. I tried to fix it by adding "PendingIntent.FLAG_IMMUTABLE", but i had no luck. Is there a solution for this problem?

    This is the error log:

    Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
    ✓  Built build/app/outputs/flutter-apk/app-debug.apk.
    Connecting to VM Service at ws://127.0.0.1:58465/2GRamNiEcaY=/ws
    I/javaClass(10003): Calling to method: initService
    I/javaClass(10003): start service invoked
    I/javaClass(10003): Attempting to initialize service...
    I/javaClass(10003): Service not bound, binding now....
    I/javaClass(10003): Mapping method call to player item object
    I/javaClass(10003): Firing up service. (onStartCommand)...
    I/javaClass(10003): LocalBroadCastManager Received...
    W/t.studiopiu.vm(10003): Accessing hidden method Landroid/media/AudioTrack;->getLatency()I (unsupported, reflection, allowed)
    I/ExoPlayerImpl(10003): Init 66048fd [ExoPlayerLib/2.13.1] [emulator64_arm64, sdk_gphone64_arm64, Google, 31]
    I/javaClass(10003): Pushing Event: flutter_radio_stopped
    I/javaClass(10003): onPlayerStateChanged: STOPPED
    I/javaClass(10003): Pushing Event: flutter_radio_loading
    I/javaClass(10003): onPlayerStateChanged: LOADING
    D/CompatibilityChangeReporter(10003): Compat change id reported: 160794467; UID 10146; state: ENABLED
    D/AndroidRuntime(10003): Shutting down VM
    E/AndroidRuntime(10003): FATAL EXCEPTION: main
    E/AndroidRuntime(10003): Process: com.example.app, PID: 10003
    E/AndroidRuntime(10003): java.lang.RuntimeException: Unable to start service me.sithiramunasinghe.flutter.flutter_radio_player.core.StreamingCore@d40233e with Intent { cmp=com.example.app/me.sithiramunasinghe.flutter.flutter_radio_player.core.StreamingCore (has extras) }: java.lang.IllegalArgumentException: com.example.app: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    E/AndroidRuntime(10003): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    E/AndroidRuntime(10003): 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4661)
    E/AndroidRuntime(10003): 	at android.app.ActivityThread.access$2000(ActivityThread.java:247)
    E/AndroidRuntime(10003): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2095)
    E/AndroidRuntime(10003): 	at android.os.Handler.dispatchMessage(Handler.java:106)
    E/AndroidRuntime(10003): 	at android.os.Looper.loopOnce(Looper.java:201)
    E/AndroidRuntime(10003): 	at android.os.Looper.loop(Looper.java:288)
    E/AndroidRuntime(10003): 	at android.app.ActivityThread.main(ActivityThread.java:7842)
    E/AndroidRuntime(10003): 	at java.lang.reflect.Method.invoke(Native Method)
    E/AndroidRuntime(10003): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    E/AndroidRuntime(10003): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
    E/AndroidRuntime(10003): Caused by: java.lang.IllegalArgumentException: com.example.app: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    E/AndroidRuntime(10003): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    E/AndroidRuntime(10003): 	at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
    E/AndroidRuntime(10003): 	at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
    E/AndroidRuntime(10003): 	at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
    E/AndroidRuntime(10003): 	at com.google.android.exoplayer2.ui.PlayerNotificationManager.createBroadcastIntent(PlayerNotificationManager.java:1395)
    E/AndroidRuntime(10003): 	at com.google.android.exoplayer2.ui.PlayerNotificationManager.createPlaybackActions(PlayerNotificationManager.java:1351)
    E/AndroidRuntime(10003): 	at com.google.android.exoplayer2.ui.PlayerNotificationManager.<init>(PlayerNotificationManager.java:658)
    E/AndroidRuntime(10003): 	at com.google.android.exoplayer2.ui.PlayerNotificationManager.<init>(PlayerNotificationManager.java:568)
    E/AndroidRuntime(10003): 	at com.google.android.exoplayer2.ui.PlayerNotificationManager.createWithNotificationChannel(PlayerNotificationManager.java:521)
    E/AndroidRuntime(10003): 	at me.sithiramunasinghe.flutter.flutter_radio_player.core.StreamingCore.onStartCommand(StreamingCore.kt:248)
    E/AndroidRuntime(10003): 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4643)
    E/AndroidRuntime(10003): 	... 9 more
    I/Process (10003): Sending signal. PID: 10003 SIG: 9
    Lost connection to device.
    Exited (sigterm)
    
    

    I tried this, but had no luck with it: (android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore)

    override fun createCurrentContentIntent(player: Player): PendingIntent {
     var intent = Intent(this@StreamingCore, activity!!.javaClass)
     var contentPendingIntent = PendingIntent.getActivity(this@StreamingCore, 0, intent, PendingIntent.FLAG_IMMUTABLE );
       return contentPendingIntent;
       }
    

    Device: Pixel 4 API 31 - Android 12.0

    [✓] Flutter (Channel beta, 2.9.0-0.1.pre, on macOS 12.1 21C52 darwin-arm, locale de-DE) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.63.2) [✓] Connected device (3 available)

    opened by gabdy 4
  • Problem with  SDK 30

    Problem with SDK 30

    Hello, Now in PlayStore it is mandatory to upload an app with SDK 30. This library gives an error when compiling in that version.

    Error log:

    e: C:\Users\leand\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-1.0.7\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (121, 90): Type mismatch: inferred type is String? but String was expected e: C:\Users\leand\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-1.0.7\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (123, 63): Type mismatch: inferred type is String? but String was expected e: C:\Users\leand\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-1.0.7\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (174, 32): Type mismatch: inferred type is String? but String was expected

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':flutter_radio_player:compileReleaseKotlin'.

    Compilation error. See log for more details

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 1m 19s

    opened by leandregg 4
  • Fatal error

    Fatal error

    Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/linar/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-1.0.5/ios/Classes/SwiftFlutterRadioPlayerPlugin.swift, line 109

    opened by glin94 4
  • Build time issue

    Build time issue

    hey all! I'm getting this build error during the time when I've added the radio player as a dependency:

    FlutterRadioPlayer/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (22, 17): Unresolved reference: localbroadcastmanager
    FlutterRadioPlayer/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (34, 93): Unresolved reference: broadcastActionName
    

    and a bunch more, Could you please help me with this?

    opened by timonsk 16
  • Not resuming playback on Internet resume

    Not resuming playback on Internet resume

    Hello,

    I have tested with internet events, when i switched off the internet it shows the flutter_radio_paused event, and on resume internet is turned into flutter_radio_loading and then nothing happened. Then on click of play button also nothing happened.

    Please help with internet events, player should play/pause as per connectivity conditions.

    Test project is the same library example.

    Thanks

    opened by deep1931 1
  • Album art does not update on Android 13 - Solution (version 1.0.1)

    Album art does not update on Android 13 - Solution (version 1.0.1)

    I realised that the album art does not update on Android 13 in version 1.0.1. After a little digging, I found that the getCurrentLargeIcon method in the RadioPlayerService.kt always returns the defaultArtwork as seen below

    override fun getCurrentLargeIcon(player: Player, callback: BitmapCallback): Bitmap? {
                    metadataArtwork = downloadImage(currentMetadata?.get(2))
    
                    metadataArtwork?.let { callback.onBitmap(it) }
                    return  defaultArtwork;
           }
    

    Changing it to the following solves the problem

    override fun getCurrentLargeIcon(player: Player, callback: BitmapCallback): Bitmap? {
                    metadataArtwork = downloadImage(currentMetadata?.get(2))
    
                    metadataArtwork?.let { callback.onBitmap(it) }
                    return if(metadataArtwork == null) defaultArtwork else metadataArtwork;
                }
    
    opened by owusukasante 1
Releases(v-2.0.0)
Owner
Sithira Munasinghe
Got any new tech 🤔?
Sithira Munasinghe
A Dart/Flutter package to register/query/remove URI Schemes without hassle.

protocol_registry Register/query/remove URI Schemes without hassle. Available for Windows and Linux. Installation flutter pub add protocol_registry Us

ZYROUGE 10 Oct 25, 2022
Dynamically changing your theme without hassle

dynamic_theme Dynamically changing your theme without hassle This packages manages changing your theme during runtime and persiting that theme. I wrot

Norbert Kozsir 329 Dec 29, 2022
Flutter Music Player - First Open Source Flutter based material design music player with audio plugin to play local music files.

Flutter Music Player First Open Source Flutter based Beautiful Material Design Music Player(Online Radio will be added soon.) Demo App Play Store BETA

Pawan Kumar 1.5k Jan 8, 2023
Just audio background - A flutter package plugs into just audio to add background playback support and remote controls

just_audio_background This package plugs into just_audio to add background playb

lonyyy 1 Jan 11, 2022
null 357 Dec 27, 2022
YoYo Video Player is a HLS(.m3u8) video player for flutter.

YoYo Video Player YoYo Video Player is a HLS(.m3u8) video player for flutter. The video_player is a video player that allows you to select HLS video s

Ko Htut 89 Dec 23, 2022
Munem Sarker 1 Jan 25, 2022
Dart/Flutter package for using Elastic App Search through a simple API returning easy to handle objects

Dart/Flutter package for using Elastic App Search through a simple API returning easy to handle objects This package is a ready-to-use API for Elastic

Julien Le Bren 5 Nov 16, 2022
server side dart micro-framework to handle incoming http requests

Queen Palace ???? Introduction server side dart micro-framework to handle incoming http requests

Ahmed Masoud 32 Aug 30, 2022
✈️ A tidy utility to handle offline/online connectivity like a Boss

✈️ Flutter Offline A tidy utility to handle offline/online connectivity like a Boss. It provides support for both iOS and Android platforms (offcourse

Jeremiah Ogbomo 845 Jan 2, 2023
Radiao - a radio explorer app that lets you listen to several stations of various countries

radiao Radiao is a radio explorer app that lets you listen to several stations of various countries. features trending stations popular stations liste

null 4 Apr 20, 2022
A mobile music streaming app with a complex UI built with Flutter and the Deezer API🚀

Sap Sap is a music streaming & discovery app built with the Deezer API for iOS and Android. It includes a mini player, search and local storage. Be su

Carlton Aikins 53 Dec 28, 2022
Music Streaming and Downloading app made in Flutter

Musify Music Streaming and Downloading app made in Flutter! Show some ❤️ and ⭐ the Repo Features Online Song Search ?? Streaming Support ?? Offline Do

Harsh Sharma 257 Dec 30, 2022
Android app to show movie ratings when browsing Netflix, Amazon Prime Video and other supported video streaming apps on the phone

Flutter - Movie Ratings You can get the latest Playstore version here on Playstore - or download directly - 0.4.5 Screenshots of master Search Page Fa

Jay Rambhia 71 Nov 23, 2022
A Flutter Plugin to visualize audio in android

flutter_visualizers (Depreciated & Not maintaining) A Flutter plugin to Visualize the audio being played (only android). Usage Add this to your pubspe

Sahdeep Singh 96 Nov 14, 2022
Audio manager - A flutter plugin for music playback, including notification handling.

audio_manager A flutter plugin for music playback, including notification handling. This plugin is developed for iOS based on AVPlayer, while android

Jerome Xiong 96 Oct 25, 2022
Video player-2.2.10 - A Flutter plugin for iOS, Android and Web for playing back video on a Widget surface

Video Player plugin for Flutter A Flutter plugin for iOS, Android and Web for pl

null 2 Sep 29, 2022
Platform to post/say something without sharing personal information.

Anon is an Open Source Application where it's users will be able to share their thoughts without their identity being revealed i.e Anonymous. When the

Ismael Shakverdiev 18 Sep 13, 2022
An architecture for dynamic UI without client deployment

Server Driven UI Demo Server Driven UI(SDUI)는 서버에서 클라이언트의 UI 컴포넌트를 관리하는 방식. 클라이언트 배포없이 API 응답을 변경하는 것만으로 UI 변경이 가능한 동시에 하위 호환성을 확보할 수 있다. Rust, GraphQ

Simon Park 15 Oct 17, 2022