Skip to content

Commit

Permalink
Updates subtitle mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
csoni111 committed Jun 14, 2017
1 parent 2b6fa8a commit a3bfc9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/amahi/anywhere/service/VideoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ public void onFilesLoaded(ServerFilesLoadedEvent event) {
List<ServerFile> files = event.getServerFiles();
for (ServerFile file:files) {
if (videoFile.getNameOnly().equals(file.getNameOnly())) {
if (Mimes.match(file.getMime()) == Mimes.Type.SUBTITLE
|| file.getExtension().equals("srt")
|| file.getExtension().equals("sub")) {
if (Mimes.match(file.getMime()) == Mimes.Type.SUBTITLE) {
mMediaPlayer.getMedia().addSlave(
new Media.Slave(
Media.Slave.Type.Subtitle, 4, getSubtitleUri(file)));
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/org/amahi/anywhere/util/Mimes.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ public class Mimes {

types.put("application/x-quicktimeplayer", Type.VIDEO);

types.put("application/x-subrip", Mimes.Type.SUBTITLE);
types.put("image/vnd.dvb.subtitle", Mimes.Type.SUBTITLE);
types.put("application/x-subrip", Mimes.Type.SUBTITLE);
types.put("image/vnd.dvb.subtitle", Mimes.Type.SUBTITLE);
types.put("application/x-subtitle", Type.SUBTITLE);
}

public static int match(String mime) {
Expand Down Expand Up @@ -130,7 +131,8 @@ public static final class Type {
public static final int PRESENTATION = 7;
public static final int SPREADSHEET = 8;
public static final int VIDEO = 9;
public static final int SUBTITLE = 10;
public static final int SUBTITLE = 10;

private Type() {
}

Expand Down

0 comments on commit a3bfc9c

Please sign in to comment.