3

Im trying to launch VLC with subtitles, but nothing happens. I have no problem with just launching VLC without subtitles.

I have tried placing

content:///storage/emulated/0/Download/TempSubtitle.srt

file:///storage/emulated/0/Download/TempSubtitle.srt

/storage/emulated/0/Download/TempSubtitle.srt

/Download/TempSubtitle.srt

/all_downloads/84

in

vlcIntent.PutExtra("subtitles_location", [here]);

and have used

vlcIntent.AddFlags(ActivityFlags.GrantReadUriPermission);
vlcIntent.AddFlags(ActivityFlags.GrantWriteUriPermission);
vlcIntent.AddFlags(ActivityFlags.GrantPrefixUriPermission);
vlcIntent.AddFlags(ActivityFlags.GrantPersistableUriPermission);

but nothing works


In the docs: [ https://wiki.videolan.org/Android_Player_Intents/ ] vlcIntent.putExtra("subtitles_location", "/sdcard/Movies/Fifty-Fifty.srt"); (java)

Android.Net.Uri uri = Android.Net.Uri.Parse(link);

Intent vlcIntent = new Intent(Intent.ActionView);
vlcIntent.SetPackage("org.videolan.vlc");

vlcIntent.SetDataAndType(uri, "video/*");

vlcIntent.PutExtra("title", "Hello World");

vlcIntent.PutExtra("subtitles_location", "file:///storage/emulated/0/Download/TempSubtitle.srt");

vlcIntent.AddFlags(ActivityFlags.GrantReadUriPermission);
vlcIntent.AddFlags(ActivityFlags.GrantWriteUriPermission);
vlcIntent.AddFlags(ActivityFlags.GrantPrefixUriPermission);

vlcIntent.AddFlags(ActivityFlags.GrantPersistableUriPermission);

StartActivityForResult(vlcIntent, 42);

It opens vlc without a problem but doesn't play the video with the subtitles. I get NO errors when I run it

  • 1
    Review the `logcat` output for warning/errors from VLC.... Also review this SO: https://stackoverflow.com/questions/48654680/unable-to-set-subtitles-with-vlc-for-android – SushiHangover Jul 06 '19 at 17:08
  • @SushiHangover This somehow worked: `vlcIntent.PutExtra("item_location", /sdcard//storage/emulated/0/Download/TempSubtitle.srt);` Thanks :) – Vincent Lagerros Jul 06 '19 at 17:48
  • EDIT: Sorry for the inconvenience, but it was a false positive. It did not solve the problem, it just seemed to solve it because vlc saved the last used subtitle location when you load a video. In my case I override the same subtitle file so it just seemed to work but in actuality it saved the subtitle path from when I selected it manually. :( – Vincent Lagerros Jul 06 '19 at 18:11
  • Check the `logcat` output for the warning/errors from VLC – SushiHangover Jul 06 '19 at 18:34
  • @Vincent Lagerros did you find a solution? – yeahman Feb 22 '20 at 08:32
  • @yeahman no :( thinking of doing my own videoplayer with https://github.com/videolan/libvlcsharp and adding subtitles myself. – Vincent Lagerros Feb 23 '20 at 13:05
  • It seams like vlc for android is having a lot of problems with PutExtra on .m3u8 files, for regular .mp4 files it can add title, start position ect, but I still cant get subtitles to work... – Vincent Lagerros May 29 '20 at 13:47
  • @VincentLagerros There is an open issue in VLC's git about subtitle intent https://code.videolan.org/videolan/vlc-android/-/issues/1203. It doesn't seem to be fixed. – mahdi Jun 02 '20 at 06:49

0 Answers0