Skip to content

Instantly share code, notes, and snippets.

@buntupana
buntupana / Mp4Parser Append
Created May 21, 2020 10:36
Functions to append mp4 files with no out of sync problem
@Throws(Exception::class)
fun appendVideos(videoPathList: List<String>, targetFilePath: String) {
val movies = videoPathList.flatMap { file -> listOf(MovieCreator.build(file)) }
val finalMovie = Movie()
val videoTracksTotal = mutableListOf<Track>()
val audioTracksTotal = mutableListOf<Track>()
/**
* Generic Adapter for a list of ITEMS and a BINDING class
*/
class SimpleListBindingAdapter<in ITEM, BINDING : ViewDataBinding> :
RecyclerView.Adapter<SimpleListBindingAdapter<ITEM, BINDING>.BindingHolder> {
private var items = listOf<ITEM>()
@LayoutRes
private var layoutRes: Int = 0