I am trying to play youtube video in exoplayer but here is some confusion I don\'t know what is DASH url, I have only real youtube url like \"https://www.youtube.com/watch
I had the same issue but i finally found the simplest solution and its working so good
First you need to call this url..
HTTP GET: https://www.youtube.com/get_video_info?&video_id=[video_id]&el=info&ps=default&eurl=&gl=US&hl=en
and don't forget to change the last id with the target one.
-just paste your data and press decode a several times to ensure it decoded well
finally search for a key called dashmpd
Or use this Simple Solution
private void extractYoutubeUrl() {
@SuppressLint("StaticFieldLeak") YouTubeExtractor mExtractor = new YouTubeExtractor(this) {
@Override
protected void onExtractionComplete(SparseArray sparseArray, VideoMeta videoMeta) {
if (sparseArray != null) {
playVideo(sparseArray.get(17).getUrl());
}
}
};
mExtractor.extract(mYoutubeLink, true, true);
implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'