问题
This code can be used to access flutter assets from Java:
String assetName = call.argument("asset");
String assetLookupKey = registrar.lookupKeyForAsset(assetName);
AssetFileDescriptor fd = registrar.context().getAssets().openFd(assetLookupKey);
player = new VideoPlayer(eventChannel, handle, fd, result);
However, how do I get registrar? I know FlutterActivity has this method:
registrarFor(String pluginKey)
But which key should I use? I'm not using any plugin, I'm trying to load the assets from my own app.
来源:https://stackoverflow.com/questions/65374762/how-to-access-flutter-assets-from-java