Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation and configuration #2

Open
fjmcassoni opened this issue Sep 5, 2020 · 5 comments
Open

Installation and configuration #2

fjmcassoni opened this issue Sep 5, 2020 · 5 comments

Comments

@fjmcassoni
Copy link

Hi Alessio,
I am struggling with installation and configuration on flutter_video_cast. I have followed all your directions in pub.dev readme.

When trying to cast a video I am getting the following error:

Performing hot reload...
Syncing files to device motorola one...
Reloaded 0 of 747 libraries in 623ms.
I/flutter (23138): URL: https://youtu.be/m6YEtI0hmIM
I/flutter (23138): Video type youtube
I/flutter (23138): ChromeCast button created
D/AndroidRuntime(23138): Shutting down VM
E/AndroidRuntime(23138): FATAL EXCEPTION: main
E/AndroidRuntime(23138): Process: com.the195company.yoga, PID: 23138
E/AndroidRuntime(23138): java.lang.IllegalStateException: The activity must be a subclass of FragmentActivity
E/AndroidRuntime(23138): at androidx.mediarouter.app.MediaRouteButton.showDialog(MediaRouteButton.java:243)
E/AndroidRuntime(23138): at androidx.mediarouter.app.MediaRouteButton.performClick(MediaRouteButton.java:305)
E/AndroidRuntime(23138): at android.view.View.performClickInternal(View.java:7133)
E/AndroidRuntime(23138): at android.view.View.access$3500(View.java:804)
E/AndroidRuntime(23138): at android.view.View$PerformClick.run(View.java:27416)
E/AndroidRuntime(23138): at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime(23138): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(23138): at android.os.Looper.loop(Looper.java:241)
E/AndroidRuntime(23138): at android.app.ActivityThread.main(ActivityThread.java:7617)
E/AndroidRuntime(23138): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(23138): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(23138): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
I/Process (23138): Sending signal. PID: 23138 SIG: 9
Lost connection to device.

For MainActivity, I did the following in MainActivity.kt:

package com.the195company.yoga

//import io.flutter.embedding.android.FlutterActivity

import com.google.android.gms.cast.framework.CastContext
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

//class MainActivity: FlutterActivity() {
//}

class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
CastContext.getSharedInstance(applicationContext)
}
}

Maybe it is a matter of properly configuring kotlin in the project, or maybe I should have done the latter in java.

I would really appreciate your help.

Thanks.

@aissamouajib
Copy link

@fjmcassoni I'm facing the same issue, could you please tell me if you've got it to work? I have a project using Java, how can I convert it to use Kotlin at least so I can follow the documentation?

Thanks in advance.

@fjmcassoni
Copy link
Author

fjmcassoni commented Jan 16, 2021 via email

@ak111in
Copy link

ak111in commented May 2, 2021

I am trying to do screen mirroring using your package, as you said
"As a workaround, projecting the whole device screen is there as a possibility depending on your specific requirmentes."
Can you please point to specific docs/example code, thanks.

@fjmcassoni
Copy link
Author

fjmcassoni commented May 10, 2021 via email

@ak111in
Copy link

ak111in commented May 12, 2021

I mean, some code/example to add the chromecast like functionality to flutter app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants