mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-07 06:28:39 +01:00
refactor: Feature/offline mode rework (#859)
Co-authored-by: lostb1t <coding-mosses0z@icloud.com> Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com> Co-authored-by: Gauvain <68083474+Gauvino@users.noreply.github.com> Co-authored-by: Gauvino <uruknarb20@gmail.com> Co-authored-by: storm1er <le.storm1er@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Chris <182387676+whoopsi-daisy@users.noreply.github.com> Co-authored-by: arch-fan <55891793+arch-fan@users.noreply.github.com> Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro.local>
This commit is contained in:
56
utils/profiles/subtitles.js
Normal file
56
utils/profiles/subtitles.js
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
const COMMON_SUBTITLE_PROFILES = [
|
||||
// Official formats
|
||||
|
||||
{ Format: "dvdsub", Method: "Embed" },
|
||||
{ Format: "dvdsub", Method: "Encode" },
|
||||
|
||||
{ Format: "idx", Method: "Embed" },
|
||||
{ Format: "idx", Method: "Encode" },
|
||||
|
||||
{ Format: "pgs", Method: "Embed" },
|
||||
{ Format: "pgs", Method: "Encode" },
|
||||
|
||||
{ Format: "pgssub", Method: "Embed" },
|
||||
{ Format: "pgssub", Method: "Encode" },
|
||||
|
||||
{ Format: "teletext", Method: "Embed" },
|
||||
{ Format: "teletext", Method: "Encode" },
|
||||
];
|
||||
|
||||
const VARYING_SUBTITLE_FORMATS = [
|
||||
"webvtt",
|
||||
"vtt",
|
||||
"srt",
|
||||
"subrip",
|
||||
"ttml",
|
||||
"ass",
|
||||
"ssa",
|
||||
"microdvd",
|
||||
"mov_text",
|
||||
"mpl2",
|
||||
"pjs",
|
||||
"realtext",
|
||||
"scc",
|
||||
"smi",
|
||||
"stl",
|
||||
"sub",
|
||||
"subviewer",
|
||||
"text",
|
||||
"vplayer",
|
||||
"xsub",
|
||||
];
|
||||
|
||||
export const getSubtitleProfiles = (secondaryMethod) => {
|
||||
const profiles = [...COMMON_SUBTITLE_PROFILES];
|
||||
for (const format of VARYING_SUBTITLE_FORMATS) {
|
||||
profiles.push({ Format: format, Method: "Embed" });
|
||||
profiles.push({ Format: format, Method: secondaryMethod });
|
||||
}
|
||||
return profiles;
|
||||
};
|
||||
Reference in New Issue
Block a user