Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1422 from edx/omer/LEARNER-7699
Browse files Browse the repository at this point in the history
Subtitles priority updated + allow video player to play videos on mobile data
  • Loading branch information
farhan-arshad-dev authored Jun 9, 2020
2 parents 80c5dca + ded4bd2 commit 02e5aa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ public static String getTranscriptURL(@NonNull Context context,
if (transcript.containsKey(subtitleLanguage)) {
transcriptUrl = transcript.get(subtitleLanguage);
} else if (transcript.entrySet().size() > 0) {
transcriptUrl = transcript.entrySet().iterator().next().getValue();
if (transcript.containsKey(Locale.ENGLISH.getLanguage())) {
transcriptUrl = transcript.get(Locale.ENGLISH.getLanguage());
} else {
transcriptUrl = transcript.entrySet().iterator().next().getValue();
}
}
return transcriptUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.edx.mobile.model.db.DownloadEntry;
import org.edx.mobile.player.PlayerFragment;
import org.edx.mobile.util.MediaConsentUtils;
import org.edx.mobile.view.dialog.IDialogCallback;

import subtitleFile.Caption;
import subtitleFile.TimedTextObject;
Expand Down Expand Up @@ -178,22 +177,7 @@ private void checkVideoStatus(VideoBlockModel unit) {
private void checkVideoStatusAndPlay(VideoBlockModel unit) {
final DownloadEntry entry = unit.getDownloadEntry(environment.getStorage());
if (!checkDownloadEntry(entry)) return;
if (entry.isDownloaded()) {
startOnlinePlay(entry);
} else {
MediaConsentUtils.requestStreamMedia(getActivity(), new IDialogCallback() {
@Override
public void onPositiveClicked() {
startOnlinePlay(entry);
}

@Override
public void onNegativeClicked() {
((BaseFragmentActivity) getActivity()).
showInfoMessage(getString(R.string.wifi_off_message));
}
});
}
startOnlinePlay(entry);
}

private void startOnlinePlay(DownloadEntry model) {
Expand Down

0 comments on commit 02e5aa9

Please sign in to comment.