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

Commit

Permalink
Allow video player to play videos on mobile data
Browse files Browse the repository at this point in the history
- LEARNER-7699
- Subtitles priority updated
- By Default English subtitles will be visible
  • Loading branch information
omerhabib26 committed Jun 9, 2020
1 parent 808ddb8 commit ded4bd2
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 ded4bd2

Please sign in to comment.