YunusEfendi.SubtitlesParser 2.0.0

SubtitleParser for Cross-Platform, Works on all Xamarin platform (Xamarin.iOS, Xamarin.Android, Xamarin.Forms), .NET and UWP

Install-Package YunusEfendi.SubtitlesParser -Version 2.0.0
dotnet add package YunusEfendi.SubtitlesParser --version 2.0.0
<PackageReference Include="YunusEfendi.SubtitlesParser" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YunusEfendi.SubtitlesParser --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Subtitle Parser Cross-Platform

SubtitleParser for Cross-Platform, Works on all Xamarin platform (Xamarin.iOS, Xamarin.Android, Xamarin.Forms) and UWP.
thanks to AlexPoint.

Install via NUGET:

Install-Package YunusEfendi.SubtitleParser

Supported format:

  • MicroDvd
  • SubRip
  • SubStationAlpha
  • SubViewer
  • TTML
  • WebVTT
  • Youtube specific XML format (still in development, contribution pleased :) )

How to Use:

UWP

async Task<StringBuilder> GetSubtitleText(StorageFile storageFile, Encoding encoding)
{
    var sb = new StringBuilder();
    var parser = new SubtitlesParser.Classes.Parsers.SrtParser();
    // note : use SubtitlesParser.Classes.Parsers.SubParser() if you don't specift the format
    using (var stream = await storageFile.OpenStreamForReadAsync())
    {
        var items = parser.ParseStream(stream, encoding);
        foreach (var i in items)
        {
            foreach (var line in i.Lines)
            {
                sb.AppendLine(line);
            }
            sb.AppendLine();
        }
    }
    return sb;
}

Subtitle Parser Cross-Platform

SubtitleParser for Cross-Platform, Works on all Xamarin platform (Xamarin.iOS, Xamarin.Android, Xamarin.Forms) and UWP.
thanks to AlexPoint.

Install via NUGET:

Install-Package YunusEfendi.SubtitleParser

Supported format:

  • MicroDvd
  • SubRip
  • SubStationAlpha
  • SubViewer
  • TTML
  • WebVTT
  • Youtube specific XML format (still in development, contribution pleased :) )

How to Use:

UWP

async Task<StringBuilder> GetSubtitleText(StorageFile storageFile, Encoding encoding)
{
    var sb = new StringBuilder();
    var parser = new SubtitlesParser.Classes.Parsers.SrtParser();
    // note : use SubtitlesParser.Classes.Parsers.SubParser() if you don't specift the format
    using (var stream = await storageFile.OpenStreamForReadAsync())
    {
        var items = parser.ParseStream(stream, encoding);
        foreach (var i in items)
        {
            foreach (var line in i.Lines)
            {
                sb.AppendLine(line);
            }
            sb.AppendLine();
        }
    }
    return sb;
}

  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETStandard 1.0

  • Portable Class Library (.NETFramework 4.5, Windows 8.0, WindowsPhone 8.0, WindowsPhoneApp 8.1)

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 773 10/1/2017