PalaTeam / flutter_video_cast

MIT License
37 stars 67 forks source link

Issue with Deep Linking #23

Open renanmgs opened 2 years ago

renanmgs commented 2 years ago

Copy from https://stackoverflow.com/questions/71237552/deeplinking-in-flutter-with-flutterfragmentactivity

I have an Streaming app that connects to ChromeCast.

It uses this package to handle the connection: https://github.com/samyakkkk/flutter_video_cast

It needs to use FlutterFragmentActivity so the connection can work, but, if i use it, i lose the hability to DeepLinking. How can i succed in this if i need to use FlutterFragmentActivity?

Here is the code that makes Chromecast Work but breaks DeepLinking:

    class MainActivity : FlutterFragmentActivity() {

    override fun provideFlutterEngine(context: Context): FlutterEngine? {
        return AudioServicePlugin.getFlutterEngine(context)
    }

    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine)
        provideFlutterEngine(applicationContext)
    }
}

Here is the code that DeepLinking works but breaks the ChromeCast connection:


    class MainActivity : FlutterActivity() {
    override fun provideFlutterEngine(context: Context): FlutterEngine? {
        configureFlutterEngine(FlutterEngine(applicationContext))
        return AudioServicePlugin.getFlutterEngine(context)
    }
}

I need to use "AudioServicePlugin" for playing audio, so this line need to be set also.