1

Seems i'm not getting the right way to code this. I can do almost everything done to my media player be functional except for this.

mfkl
  • 1,914
  • 1
  • 11
  • 21

1 Answers1

4

This is a bit tricky, and not exposed by the LibVLC public API, which is why you can't find a C# function for this. But there is a way.

First, read how to use LibVLC options

Then find the one you want from the Wiki.

These look like what you're looking for

--freetype-rel-fontsize=<int> Size

--freetype-bold

--freetype-color=<int> color

Use it like this

var libvlc = new LibVLC("--freetype-bold", "--freetype-rel-fontsize=10", "--freetype-color=65280");

And you would get green, bold, extra large subtitles.

For looking up usage and parameter info, you can also check out how the VLC apps use it. Here is VLC for Android libvlc options usage.

mfkl
  • 1,914
  • 1
  • 11
  • 21
  • Mark the answer as validated if it answered your question please. And my name's not Flavio :D – mfkl Dec 19 '19 at 09:20
  • It's a good solution to set options before creating a media instance and play media, but what should I do if I want to change the options while a video is playing. for example, I need a solution to change the font while the user is watching the video. I try to use `_mediaPlayer.Media.AddOption(":freetype-rel-fontsize=10")` but It doesn't work after I create media instance and play video. – Mohammad Apr 10 '20 at 10:43
  • I'm not sure you can do this with LibVLC – mfkl Apr 10 '20 at 17:59