S
S
StynuBlizz2017-07-31 00:43:25
Android
StynuBlizz, 2017-07-31 00:43:25

How to determine in advance the size of the player for a video downloaded from the Internet?

Problem: I am making an event feed (consisting of video), to fill in the event feed, first I upload data about what this feed consists of, among these data there is a link to the video, and then I upload the video using this link. The problem is that before the video from the link is loaded (meta data about the resolution of the video), the size of the player (I use ExoPlayer) is incorrect and changes to the correct one only after loading the meta data. And because of this, it turns out that the sizes of the tape elements change while the tape is scrolling, but I need it like in Instagram, that is, before the media file has been loaded, the player already knows what size it should be. How to do it?
As an option, I think it is possible to store the video resolution (or ratio?) in the database and adjust the size of the player during the download of data (which is with a link)? Or are there better solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Varakosov, 2017-07-31
@thelongrunsmoke

Do you know the aspect ratio of the video? Use ratio in ConstraintLayout.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question