简体   繁体   English

我想在Android上写一个flutter视频插件。 我想按纹理写在 kotlin native 上

[英]I want to write a flutter video plug-in on Android. I want to write it on kotlin native by texture

I want to write a flutter video plug-in on Android.我想在Android上写一个flutter视频插件。 I want to write it on kotlin native by texture我想按纹理写在 kotlin native 上

Rendering with texture widget on flutter在 flutter 上使用纹理小部件进行渲染

But I have some problems但是我有一些问题

He threw out some information他抛出了一些信息


call to OpenGL ES API with no current context (logged once per thread)

I called我打了电话


val texId=IntArray(1);

GLES20.glGenTextures(texId.size,texId,0)

he return texId is 0他返回 texId 为 0

  override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
    print("call ${call.method}")
    when(call.method){
      "getPlatformVersion"->{
        result.success("Android ${android.os.Build.VERSION.RELEASE}")
      }
      "playVideo"->{
        val texId=IntArray(1);
        GLES20.glGenTextures(texId.size,texId,0)
        Log.d("autopcDev", "Tex Id : ${texId[0].toString()}")
        val mp=MediaPlay( uri= Uri.fromFile(File((call.arguments as Map<*, *>)["path"] as String)),context = activity)
        result.success(mp.tex[0])
      }
    }
  }

glSurfaceView does not run on the OpenGL thread. glSurfaceView 不在 OpenGL 线程上运行。 The glSurfaceView should be on the main android thread. glSurfaceView 应该在主 android 线程上。

The constructor for GLES20 methods , which could be causing the problem. GLES20 方法的构造函数,这可能会导致问题。 Try instantiating it after the call to " setRenderer(render); " or inside the " onSurfaceCreated " method.尝试在调用“ setRenderer(render); ”之后或在“ onSurfaceCreated ”方法内实例化它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想在 android 中使用 kotlin 语言向视频添加文本。我该怎么做。? - I want to add text to video using kotlin language in android. How can I do it.? 我想在使用Android Eclipse ADT插件的同时自定义构建过程 - I want to customize the build process while still using the Android Eclipse ADT plug-in 我想在Android的字符串中写数字符号 - I want to write Number sign in string of android 我想在Android中显示超链接项目的列表。 - I want to display a list of hyperlinked items in Android. 有什么方法可以在Android的SD卡上任何地方写东西吗? - Is there any way to write wherever I want on a SD card in Android? 我想从字符串中写入 AdUnitId? - I want to write the AdUnitId from String? 我想写一个变量 JSON 的固定值 - I want to write a fixed value of a variable JSON 我想在原生 android 和 java 或 kotlin 中创建与 amazon 和 flipkart 相同的过滤屏幕。这怎么可能? - I want to create the filter screen same as amazon and flipkart in native android with java or kotlin. How is it possible? 我正在使用Android Studio,我想通过模拟器写入本地文本文件 - I am using Android studio I want to write local text file via emulator 我想知道如何将 InputStream 内容写入 XML 文件(android) - I want know how I can write my InputStream content to an XML file (android)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM