wlanjie / trinity

android video record editor muxer sdk
Apache License 2.0
888 stars 273 forks source link

Can Someone help me with how to export video with new version 0.3.2 #131

Closed hgaharwar closed 3 years ago

hgaharwar commented 3 years ago

Not able to create INSTANCE for TRINITY CORE in export activity

Empiere commented 3 years ago

Hey @hgaharwar Please find herewith the solution

You can create VideoEditor like this

In VideoEdtior Activity var darftPath : String = externalCacheDir?.absolutePath + "/video.mp4" mVideoEditor = TrinityCore.createEditor(activity.this, darftPath )

In VideoExportAcitiy var darftPath : String = externalCacheDir?.absolutePath + "/video.mp4" mVideoExport = TrinityCore.createExport(darftPath) mVideoExport.export(info, this)

InRecordActivity onCreate Method put this code to delete cache prior to start new record try { if (File(externalCacheDir!!.absolutePath).exists()) { File(externalCacheDir!!.absolutePath).deleteRecursively() } } catch (e: java.lang.Exception) { e.printStackTrace() }

I did very well using this code. Thanks @wlanjie for this great library. You deserve a lot thanks