2

I have used this code but it does not work for HLS video...

MediaMetadataRetriever retriever = new MediaMetadataRetriever();
                            if (Build.VERSION.SDK_INT >= 14)
                                retriever.setDataSource("link" + movie.get(i).getMMovie(), new HashMap<String, String>());
                            else
                                retriever.setDataSource("link" + movie.get(i).getMMovie());
                            //retriever .setDataSource("Your video url");
                            String mVideoDuration2 = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
                            long mTimeInMilliseconds2 = Long.parseLong(mVideoDuration2);

Please provide the solution for this..

Nupur Soni
  • 38
  • 4
  • check this https://stackoverflow.com/questions/36708107/get-video-duration-from-url-in-android-app – Jaiprakash Soni Mar 26 '21 at 04:54
  • here is link to answer solves this exact problem using exoplayer since other solutions didn't work https://stackoverflow.com/a/71708709/6039240 – Amr Apr 01 '22 at 14:44

0 Answers0