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 #1460 from edx/omer/LEARNER-7560
Browse files Browse the repository at this point in the history
Caption blinking and settings handled on Video player
  • Loading branch information
omerhabib26 authored Sep 10, 2020
2 parents 85d42a9 + f99325c commit 1c74235
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ public abstract class BaseCourseUnitVideoFragment extends CourseUnitFragment
}
}
// Only Allow handler to post the runnable when fragment is visible to user
if (getUserVisibleHint()) {
if (isVisible()) {
subtitleDisplayHandler.postDelayed(this.subtitlesProcessorRunnable, SUBTITLES_DISPLAY_DELAY_MS);
} else {
updateClosedCaptionData(null);
}
};

Expand Down Expand Up @@ -217,8 +219,9 @@ private void initTranscripts() {
initTranscriptListView();
updateTranscript(subtitlesObj);
String subtitleLanguage = LocaleUtils.getCurrentDeviceLanguage(getActivity());
if (!android.text.TextUtils.isEmpty(subtitleLanguage) &&
getTranscriptModel().entrySet().contains(subtitleLanguage)) {
if (loginPrefs.getSubtitleLanguage() == null &&
!android.text.TextUtils.isEmpty(subtitleLanguage) &&
getTranscriptModel().containsKey(subtitleLanguage)) {
loginPrefs.setSubtitleLanguage(subtitleLanguage);
}
showClosedCaptionData(subtitlesObj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ public void onItemClicked(HashMap<String, String> language) {
HashMap<String, String> hm;
for(int i=0; i<langList.size();i++){
hm = new HashMap<String, String>();
hm.put(langList.keySet().toArray()[i].toString(),
hm.put(langList.keySet().toArray()[i].toString(),
langList.values().toArray()[i].toString());
ccAdaptor.add(hm);
}
}
String langSelected = getArguments().getString("selectedLanguage");

if (langSelected != null && !langList.containsKey(langSelected)) {
langSelected = langList.keySet().toArray()[0].toString();
}
ccAdaptor.selectedLanguage = langSelected;
ccAdaptor.notifyDataSetChanged();

Expand Down

0 comments on commit 1c74235

Please sign in to comment.