question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Showing subtitle on Exoplayer (Leanback)

See original GitHub issue

💬 Questions and Help

Hello,

Previously I was using Xam.Plugins.Android.ExoPlayer.Leanback version 2.11.8. I was able to load the subtitles using the following code

` var subtitleView = RequireActivity().FindViewById(Resource.Id.leanback_subtitles) as SubtitleView;

    var style = new CaptionStyleCompat(
        Color.White,
        Color.Transparent,
        Color.Transparent,
        CaptionStyleCompat.EdgeTypeDropShadow,
        Color.Black,
        Typeface.Default!);

    var subtitleSize = GlobalSettings.GetFloat(GlobalSettings.KeySubtitleSize);

    if (subtitleSize != null)
    {
        subtitleView?.SetFixedTextSize((int)ComplexUnitType.Sp, subtitleSize.Value);
    }

    subtitleView?.SetApplyEmbeddedStyles(false);
    subtitleView?.SetStyle(style);

    if (subtitleView != null)
    {
        var textComponent = _player.TextComponent;
        textComponent.AddTextOutput(subtitleView);
    }

`

Now after upgrading to version 2.18.9 I am not able to call textComponent.AddTextOutput(subtitleView); Seems like AddTextOutput function isn’t available anymore. Can anyone please help how can I make subtitles work.

Thanks

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
isaranghicommented, Feb 16, 2023

@ArchangelWTF yes it worked with the List<Cue> exposed and setting it by calling subtitleView.SetCues. Would you be able to merge your changes and update the nuget package?

0reactions
ArchangelWTFcommented, Feb 16, 2023

@isaranghi Did you manage to get this working yet?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Showing subtitle on Exoplayer (Leanback) - android
Android.ExoPlayer.Leanback version 2.11.8. I was able to load the subtitles using the following code var subtitleView = RequireActivity().
Read more >
Subtitles are not shown with leanback extension enabled
Hi,. i am using leanback-extension on exoplayer 2.10.5,. if i use exoplayer without leanback extensions dvbsub subtitles are shown,.
Read more >
Showing Subtitles/Lyrics on Android Exoplayer | by PrepNew
When you are playing just attach one media source to audio player but when you want to display subtitle then you need one...
Read more >
Supported formats
ExoPlayer supports standalone subtitle files in a variety of formats. Subtitle files can be side-loaded as described on the media items page ...
Read more >
Media3 ExoPlayer
Build apps that give your users seamless experiences from phones to tablets, watches, and more. ... Learn to build for your use case...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found