Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support loading subtitle-only URLs #55

Closed
mariodivece opened this issue Jul 27, 2017 · 6 comments
Closed

Support loading subtitle-only URLs #55

mariodivece opened this issue Jul 27, 2017 · 6 comments
Assignees

Comments

@mariodivece
Copy link
Member

Currently, there is no way to specify or automatically load a subtitle file. Implement a SubtitleInputContext in the container supporting Play, Stop, Pause and seek operations.

@mariodivece mariodivece self-assigned this Jul 27, 2017
@mariodivece mariodivece added this to the 2.0 (Michelob) milestone Jul 27, 2017
@ghost
Copy link

ghost commented Oct 29, 2017

It would be awesome to have this feature! Do you think it is complex to implement?

@mariodivece mariodivece modified the milestones: 2.0 (Michelob), 3.0 Floyd Jan 15, 2018
@Ravenglass
Copy link

Hi,

This would be awesome. Any ideas on when we can expect this? Right now I'm loading and adding subtitles separately as an overlay. Would be cool to be able to select external subtitle files. Thanx, this is by far the best MediaElement alternative I've used.

Cheers,

@mariodivece
Copy link
Member Author

No exact target date yet. I need to release the 2.0 version this weekend. I will start working on 3.0 features soon enough. If it is any help to you, the Mediaelement contains a good subtitles control already that displays the subtitle stream inside a media file

@Ravenglass
Copy link

Ravenglass commented Feb 2, 2018

Hi @mariodivece,

Thanx. That might be much better than having a separate textbox. But how would I access and update the text value of the existing control? Would that be possible? Could you point me in the right direction?

Cheers,

mariodivece added a commit that referenced this issue Feb 3, 2018
@mariodivece
Copy link
Member Author

mariodivece commented Feb 3, 2018

In my latest NuGet (3.4.200) you are able to set the attached property like this:

Subtitles.SetText(Media, "HEY THERE!");

@mariodivece mariodivece modified the milestones: 3.0 - Floyd, 2.10 - Michelob Feb 5, 2018
@mariodivece
Copy link
Member Author

Latest Commit. See example of side-loading subtitles:

        private void Media_MediaOpening(object sender, MediaOpeningRoutedEventArgs e)
        {
            // Example of automatically side-loading SRT subs
            try
            {
                var inputUrl = e.Info.InputUrl;
                var url = new Uri(inputUrl);
                if (url.IsFile || url.IsUnc)
                {
                    inputUrl = System.IO.Path.ChangeExtension(url.LocalPath, "srt");
                    if (System.IO.File.Exists(inputUrl))
                        e.Options.SubtitlesUrl = inputUrl;
                }
            }
            catch { }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants