feat(src/pages/components/activity/stream_info.jsx): add transcode reasons and update video/audio stream detection logic.

This commit is contained in:
sususu98
2025-03-11 15:42:45 +08:00
parent 03b3899f6d
commit 49d7382a65
2 changed files with 25 additions and 3 deletions

View File

@@ -305,5 +305,6 @@
"TIMEZONE": "时区",
"POSTCODE": "邮编",
"X_ROWS_SELECTED": "已选中 {ROWS} 行",
"TRANSCODE_REASONS": "转码原因",
"SUBTITLES": ""
}

View File

@@ -61,7 +61,13 @@ function Row(logs) {
<TableRow>
<TableCell ><strong><Trans i18nKey={"VIDEO"}/></strong></TableCell>
<TableCell colSpan="2" style={{textTransform:"uppercase"}}><strong>{data.TranscodingInfo ? (data.TranscodingInfo?.IsVideoDirect ? i18next.t("DIRECT") :i18next.t("TRANSCODE")):i18next.t("DIRECT")}</strong></TableCell>
<TableCell colSpan="2" style={{textTransform:"uppercase"}}><strong>
{data.PlayMethod === "DirectStream" ?
i18next.t("DIRECT_STREAM") :
(data.TranscodingInfo ?
(data.TranscodingInfo?.IsVideoDirect ? i18next.t("DIRECT") : i18next.t("TRANSCODE")) :
i18next.t("DIRECT"))}
</strong></TableCell>
</TableRow>
<TableRow>
@@ -108,7 +114,13 @@ function Row(logs) {
<TableRow>
<TableCell ><strong><Trans i18nKey={"AUDIO"}/></strong></TableCell>
<TableCell colSpan="2" style={{textTransform:"uppercase"}}><strong>{data.TranscodingInfo ? (data.TranscodingInfo?.IsAudioDirect ? i18next.t("DIRECT") :i18next.t("TRANSCODE")):i18next.t("DIRECT")}</strong></TableCell>
<TableCell colSpan="2" style={{textTransform:"uppercase"}}><strong>
{data.PlayMethod === "DirectStream" ?
i18next.t("DIRECT_STREAM") :
(data.TranscodingInfo ?
(data.TranscodingInfo?.IsAudioDirect ? i18next.t("DIRECT") : i18next.t("TRANSCODE")) :
i18next.t("DIRECT"))}
</strong></TableCell>
</TableRow>
<TableRow>
@@ -135,7 +147,16 @@ function Row(logs) {
<TableCell className="py-0 pb-3" >{data.MediaStreams ? data.MediaStreams.find(stream => stream.Type === 'Audio' && stream.Index===data.PlayState?.AudioStreamIndex)?.Language?.toUpperCase() : '-'}</TableCell>
</TableRow>
{data.TranscodingInfo && data.TranscodingInfo?.TranscodeReasons && data.TranscodingInfo.TranscodeReasons.length > 0 && (
<>
<TableRow>
<TableCell colSpan="3"><strong><Trans i18nKey={"TRANSCODE_REASONS"}/></strong></TableCell>
</TableRow>
<TableRow>
<TableCell className="py-0 pb-3" colSpan="3">{data.TranscodingInfo.TranscodeReasons.join(", ")}</TableCell>
</TableRow>
</>
)}
</React.Fragment>
);