diff --git a/android/build.gradle b/android/build.gradle index 8f0b13a..4ca025a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -122,4 +122,10 @@ if (flutterSdkVersionInt < 32400) { preprocessJava(['//// FLUTTER_3.24_BEGIN': '/\\*// FLUTTER_3.24_BEGIN-', '//// FLUTTER_3.24_END': '\\*/// FLUTTER_3.24_END-']) } else { preprocessJava(['/\\*// FLUTTER_3.24_BEGIN-': '//// FLUTTER_3.24_BEGIN', '\\*/// FLUTTER_3.24_END-': '//// FLUTTER_3.24_END']) + /// rename onSurfaceAvailable to onSurfaceCreated if flutterSdkVersionInt < 32700 + if (flutterSdkVersionInt < 32700) { + println 'rename onSurfaceAvailable to onSurfaceCreated' + preprocessJava(['onSurfaceAvailable': 'onSurfaceCreated']) + } } + diff --git a/android/src/main/java/com/mediadevkit/fvp/FvpPlugin.java b/android/src/main/java/com/mediadevkit/fvp/FvpPlugin.java index a32892f..39f9244 100644 --- a/android/src/main/java/com/mediadevkit/fvp/FvpPlugin.java +++ b/android/src/main/java/com/mediadevkit/fvp/FvpPlugin.java @@ -93,8 +93,8 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { sp.setCallback( new TextureRegistry.SurfaceProducer.Callback() { @Override - public void onSurfaceCreated() { - Log.d("FvpPlugin", "SurfaceProducer.onSurfaceCreated for textureId " + texId); + public void onSurfaceAvailable() { + Log.d("FvpPlugin", "SurfaceProducer.onSurfaceAvailable for textureId " + texId); final Surface newSurface = sp.getSurface(); surfaces.put(texId, newSurface); // will do nothing if same surface