Currently i'm in process of making android application which should have feature of playing movie with subtitle from upnp server to vlc media player on android. Problem is that vlc media player doesn't recognize any subtitle associated with media. Media itself is playing perfectly fine after executing intent from my application, only problem is subtitles not showing up (Subtitle option in vlc player is grayed out). Technologies I have been using so far are following:
Serviio upnp media server,
Cling-core and support library 2.1.1,
And 2 testing devices:
Device 1: API 26, VLC player version 3.0.13
Device 2: API 22, VLC player version 2.0.6
On Serviio media server movies are contained in their respective directories along with .srt files that represents subtitles for them. Cling is used for interaction with media server (fetching movies, metadata, etc). Code that interacts with media server is this one:
this.upnpService.getControlPoint().execute(new Browse(service, "V_M", BrowseFlag.DIRECT_CHILDREN) {
@Override
public void received(ActionInvocation arg0,
DIDLContent didl) {
int id = 0;
for (Item item : didl.getItems()){
movieParcelables.add(
new MovieParcelable(id,
item.getTitle(),
item.getFirstPropertyValue(DIDLObject.Property.DC.DESCRIPTION.class),
Integer.parseInt(item.getFirstPropertyValue(DIDLObject.Property.DC.DATE.class).substring(0, 4)),
item.getFirstPropertyValue(DIDLObject.Property.UPNP.ICON.class).toString(),
item.getFirstResource().getValue()));
id++;
}
And here is method that creates and starts intent for selected movie:
public void onPlayClick(View v){
//TODO implement play movie intent...
Uri uri = Uri.parse(movie.getmURL());
Intent vlcIntent = new Intent(Intent.ACTION_VIEW);
vlcIntent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
vlcIntent.addFlags(Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
vlcIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
vlcIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
vlcIntent.setDataAndTypeAndNormalize(uri, "video/*");
vlcIntent.putExtra("title", movie.getmTitle());
vlcIntent.putExtra("subtitles_location", movie.getmURL());
startActivity(vlcIntent);
}
Guess that i'm missing something important but not exactly sure what is it... Thing that is also worth mentioning is that if I go straight to vlc media player by myself, and manually discover, manually navigate through media server and play movie that way it starts and also offers subtitles for chosen movie. So its certain that server offers subtitle option for client side.
Thanks in advance for any help.