HaarigerHarald / android-youtubeExtractor

Deprecated: Android based YouTube URL extractor and downloader
Other
877 stars 304 forks source link

Loading tags taking very long time in fragments #119

Open rogermule opened 4 years ago

rogermule commented 4 years ago
    new YouTubeExtractor(myContext) {
        @Override
        public void onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta vMeta) {
            mainProgressBar.setVisibility(View.GONE);
            if (ytFiles != null) {
                if (ytFiles == null) {
                    // Something went wrong we got no urls. Always check this.
                    Log.i("DownloadURL", "YT file NONE ");
                    return;
                }

                Log.i("DownloadURL", "Tags avalable " + ytFiles.size());
                updateView(ytFiles,vMeta);
            }
        }
    }.extract(videoURl, false, false);

The above code executes in 2 seconds when it is inside an activity where as the same code with the same internet speed executes in more than 10 seconds in a fragment. What should I do to make the code execute faster in fragments?