Commit 179b4b08 authored by Geoffrey Métais's avatar Geoffrey Métais

Always check for subtitles

Fixes #615
parent 7c4d5ddd
......@@ -1640,6 +1640,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
setESTracks();
if (mTitle != null && mTitle.length() == 0)
mTitle.setText(mw.getTitle());
// Get possible subtitles
getSubtitles();
}
private void encounteredError() {
......@@ -2849,9 +2851,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
else
mService.loadUri(mUri);
// Get possible subtitles
getSubtitles();
// Get the title
if (itemTitle == null && !TextUtils.equals(mUri.getScheme(), "content"))
title = mUri.getLastPathSegment();
......@@ -2860,8 +2859,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
} else {
mService.loadLastPlaylist(Constants.PLAYLIST_TYPE_VIDEO);
}
if (itemTitle != null)
title = itemTitle;
if (itemTitle != null) title = itemTitle;
mTitle.setText(title);
if (mWasPaused) {
......@@ -2903,8 +2901,13 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
}
}
if (!TextUtils.equals(mUri.getScheme(), "content"))
prefsList.addAll(MediaDatabase.getInstance().getSubtitles(mUri.getLastPathSegment()));
String mediaTitle = null;
if (mUri != null && !TextUtils.equals(mUri.getScheme(), "content")) mediaTitle = mUri.getLastPathSegment();
else if (mService != null) {
final MediaWrapper mw = mService.getCurrentMediaWrapper();
if (mw != null) mediaTitle = FileUtils.getFileNameFromPath(mService.getCurrentMediaWrapper().getLocation());
}
if (mediaTitle != null) prefsList.addAll(MediaDatabase.getInstance().getSubtitles(mediaTitle));
return prefsList;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment