MediaWrapper/Helpers/ExtensionHelper.cs
/// <summary>
/// Returns the appropriate extension given an subtitle codec
/// </summary>
/// <param name="subtitleCodec"></param>
/// <returns></returns>
Returns the appropriate extension given an subtitle codec
Returns the appropriate extension given an subtitle codec
public static Extension GetSubtitleExtension(SubtitleCodec subtitleCodec)
        {
            if (subtitleCodec.Codec == SubtitleCodec.PGS.Codec)
            {
                return Extension.SUP;
            }
            if (subtitleCodec.Codec == SubtitleCodec.KATE.Codec)
            {
                return Extension.OGG;
            }
            if (subtitleCodec.Codec == SubtitleCodec.TEXT_SSA.Codec || subtitleCodec.Codec == SubtitleCodec.SSA.Codec)
            {
                return Extension.SSA;
            }
            if (subtitleCodec.Codec == SubtitleCodec.TEXT_ASS.Codec || subtitleCodec.Codec == SubtitleCodec.ASS.Codec)
            {
                return Extension.ASS;
            }
            if (subtitleCodec.Codec == SubtitleCodec.TEXT_ASCII.Codec || subtitleCodec.Codec == SubtitleCodec.TEXT_UTF.Codec)
            {
                return Extension.SRT;
            }
            if (subtitleCodec.Codec == SubtitleCodec.TEXT_USF.Codec)
            {
                return Extension.USF;
            }
            if (subtitleCodec.Codec == SubtitleCodec.TEXT_WEB.Codec)
            {
                return Extension.WEBVTT;
            }
            if (subtitleCodec.Codec == SubtitleCodec.SUB.Codec)
            {
                return Extension.SUB;
            }
            throw new UnkownExtentionException($"Unkown extension for codec: {subtitleCodec.Codec}");
        }
public static Extension GetSubtitleExtension ( SubtitleCodec subtitleCodec ) { if ( subtitleCodec . Codec == SubtitleCodec . PGS . Codec ) { return Extension . SUP ; } if ( subtitleCodec . Codec == SubtitleCodec . KATE . Codec ) { return Extension . OGG ; } if ( subtitleCodec . Codec == SubtitleCodec . TEXT_SSA . Codec || subtitleCodec . Codec == SubtitleCodec . SSA . Codec ) { return Extension . SSA ; } if ( subtitleCodec . Codec == SubtitleCodec . TEXT_ASS . Codec || subtitleCodec . Codec == SubtitleCodec . ASS . Codec ) { return Extension . ASS ; } if ( subtitleCodec . Codec == SubtitleCodec . TEXT_ASCII . Codec || subtitleCodec . Codec == SubtitleCodec . TEXT_UTF . Codec ) { return Extension . SRT ; } if ( subtitleCodec . Codec == SubtitleCodec . TEXT_USF . Codec ) { return Extension . USF ; } if ( subtitleCodec . Codec == SubtitleCodec . TEXT_WEB . Codec ) { return Extension . WEBVTT ; } if ( subtitleCodec . Codec == SubtitleCodec . SUB . Codec ) { return Extension . SUB ; } throw new UnkownExtentionException ( $" Unkown extension for codec:  { subtitleCodec . Codec } " ) ; }
Returns the appropriate extension given an subtitle codec
Returns the appropriate extension given an subtitle codec
None
subtitleCodec
SubtitleCodec
None