![](/img/trans.png)
[英]I want to add text to video using kotlin language in android. How can I do it.?
[英]I want to write a flutter video plug-in on Android. I want to write it on kotlin native by texture
我想在Android上写一个flutter视频插件。 我想按纹理写在 kotlin native 上
在 flutter 上使用纹理小部件进行渲染
但是我有一些问题
他抛出了一些信息
call to OpenGL ES API with no current context (logged once per thread)
我打了电话
val texId=IntArray(1);
GLES20.glGenTextures(texId.size,texId,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 不在 OpenGL 线程上运行。 glSurfaceView 应该在主 android 线程上。
GLES20 方法的构造函数,这可能会导致问题。 尝试在调用“ setRenderer(render);
”之后或在“ onSurfaceCreated
”方法内实例化它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.