Skip to content

Commit

Permalink
fix: fixed load recently selected quality for video
Browse files Browse the repository at this point in the history
  • Loading branch information
MrIkso committed Jul 6, 2024
1 parent e3f790e commit 9b28548
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,16 @@ private void setMediaSourceByModel(VideoLinksModel model) {
if (model.getLinksQuality() != null && !model.getLinksQuality().isEmpty()) {
Map<String, String> qualitiesMap = model.getLinksQuality();

currentQuality = model.getDefaultQuality();
//currentQuality = model.getDefaultQuality();

if (Strings.isNullOrEmpty(currentQuality)) {
currentQuality = qualitiesMap.keySet().stream().findFirst().get();
if (Strings.isNullOrEmpty(currentQuality) && !qualitiesMap.containsKey(currentQuality)) {
// load default player quality
var defaultQuality = model.getDefaultQuality();
if (!Strings.isNullOrEmpty(defaultQuality)) {
currentQuality = defaultQuality;
} else {
currentQuality = qualitiesMap.keySet().stream().findFirst().get();
}
}

// qualitiesMap.forEach((key, value) -> Log.i("tag", "currentQuality: " + currentQuality + " " + key + " " + value));
Expand Down

0 comments on commit 9b28548

Please sign in to comment.