-
Notifications
You must be signed in to change notification settings - Fork 93
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
Error playing video - Trying to create a platform view of unregistered type: tv.mta/NativeVideoPlayer - 2.0.2-rc1 #86
Comments
lucascardo12
changed the title
Error playing video - Trying to create a platform view of unregistered type: tv.mta/NativeVideoPlayer
Error playing video - Trying to create a platform view of unregistered type: tv.mta/NativeVideoPlayer - 2.0.2-rc1
Apr 27, 2022
Hello Lucas, so it seems the plugin need to be registered in your app's MainActivity class. Please see below how to do this. Java public class MainActivity extends FlutterActivity {
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
/* video player */
tv.mta.flutter_playout.video.PlayerViewFactory.registerWith(
flutterEngine.getPlatformViewsController().getRegistry(),
flutterEngine.getDartExecutor().getBinaryMessenger(),
this);
/* audio player */
tv.mta.flutter_playout.audio.AudioPlayer.registerWith(
flutterEngine.getDartExecutor().getBinaryMessenger(),
this,
this.getContext());
}
} Kotlin class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
tv.mta.flutter_playout.video.PlayerViewFactory.registerWith(
flutterEngine.platformViewsController.registry,
flutterEngine.dartExecutor.binaryMessenger,
this)
tv.mta.flutter_playout.audio.AudioPlayer.registerWith(
flutterEngine.dartExecutor.binaryMessenger,
this, context)
}
} |
thanks, good work |
error: cannot find symbol |
to anyone having this issue, this is my full code in MainActivity.java
|
This is causing error in await Firebase.initializeApp(); |
Open
same error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: tv.mta/NativeVideoPlayer
E/flutter (10424): at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:199)
E/flutter (10424): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:107)
E/flutter (10424): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/flutter (10424): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter (10424): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
E/flutter (10424): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
E/flutter (10424): at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
E/flutter (10424): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (10424): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (10424): at android.os.Looper.loopOnce(Looper.java:201)
E/flutter (10424): at android.os.Looper.loop(Looper.java:288)
E/flutter (10424): at android.app.ActivityThread.main(ActivityThread.java:7842)
E/flutter (10424): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (10424): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/flutter (10424): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/flutter (10424): , null, null)
E/flutter (10424): #0 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:607
E/flutter (10424): #1 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:177
E/flutter (10424):
E/flutter (10424): #2 TextureAndroidViewController._sendCreateMessage
package:flutter/…/services/platform_views.dart:1061
E/flutter (10424):
E/flutter (10424): #3 AndroidViewController.create
package:flutter/…/services/platform_views.dart:771
E/flutter (10424):
E/flutter (10424): #4 RenderAndroidView._sizePlatformView
package:flutter/…/rendering/platform_view.dart:191
E/flutter (10424):
E/flutter (10424):
The text was updated successfully, but these errors were encountered: