I'm trying to display a video thumbnail of the post. The user is able to enter a link from Youtube, Mixer, and Twitch videos and I'm a noob so I'm not sure how to get an actual thumbnail from that videos.
Here is the code that I'm using right now, it's working well, but I don't want all videos to show exactly the same thumbnails so I'd like to show an actual thumbnail.
when (post.type){
"twitch" -> {
post_image.setImageResource(R.drawable.twitch)
}
"youtube" -> {
post_image.setImageResource(R.drawable.youtube)
}
"mixer" -> {
post_image.setImageResource(R.drawable.mixer)
}
else -> {
post_image.setImageResource(R.drawable.image_placeholder)
}
}