From daff76354bc5ae056b92290b72b1a71aaf44cad1 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Tue, 17 Nov 2020 13:01:31 +0800 Subject: [PATCH 1/6] add description for remux --- src/components/playerstats/playerstats.js | 18 ++++++++++++++++++ src/controllers/dashboard/dashboard.js | 15 ++++++++++++--- src/strings/en-us.json | 17 ++++++++++++++--- src/strings/zh-cn.json | 17 ++++++++++++++--- 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/components/playerstats/playerstats.js b/src/components/playerstats/playerstats.js index e100dee594..354002a267 100644 --- a/src/components/playerstats/playerstats.js +++ b/src/components/playerstats/playerstats.js @@ -371,6 +371,17 @@ import 'css!./playerstats'; const session = responses[1]; const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session); + let localizedDisplayMethod = displayPlayMethod; + + if (displayPlayMethod === 'DirectPlay') { + localizedDisplayMethod = globalize.translate('DirectPlaying'); + } else if (displayPlayMethod === 'Remux') { + localizedDisplayMethod = globalize.translate('Remuxing'); + } else if (displayPlayMethod === 'DirectStream') { + localizedDisplayMethod = globalize.translate('DirectStreaming'); + } else if (displayPlayMethod === 'Transcode') { + localizedDisplayMethod = globalize.translate('Transcoding'); + } const baseCategory = { stats: [], @@ -401,6 +412,13 @@ import 'css!./playerstats'; categories.push(category); } + let localizedTranscodingInfo = globalize.translate('LabelTranscodingInfo'); + if (displayPlayMethod === 'Remux') { + localizedTranscodingInfo = globalize.translate('LabelRemuxingInfo'); + } else if (displayPlayMethod === 'DirectStream') { + localizedTranscodingInfo = globalize.translate('LabelDirectStreamingInfo'); + } + if (session.TranscodingInfo) { categories.push({ stats: getTranscodingStats(session, player, displayPlayMethod), diff --git a/src/controllers/dashboard/dashboard.js b/src/controllers/dashboard/dashboard.js index 855ce3ff03..d5dcf9ca49 100644 --- a/src/controllers/dashboard/dashboard.js +++ b/src/controllers/dashboard/dashboard.js @@ -27,7 +27,12 @@ import 'emby-itemscontainer'; const text = []; const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session); - if (displayPlayMethod === 'DirectStream') { + if (displayPlayMethod === 'Remux') { + title = globalize.translate('Remuxing'); + text.push(globalize.translate('RemuxHelp1')); + text.push('
'); + text.push(globalize.translate('RemuxHelp2')); + } else if (displayPlayMethod === 'DirectStream') { title = globalize.translate('DirectStreaming'); text.push(globalize.translate('DirectStreamHelp1')); text.push('
'); @@ -395,7 +400,11 @@ import 'emby-itemscontainer'; let showTranscodingInfo = false; const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session); - if (displayPlayMethod === 'DirectStream') { + if (displayPlayMethod === 'DirectPlay') { + html += globalize.translate('DirectPlaying'); + } else if (displayPlayMethod === 'Remux') { + html += globalize.translate('Remuxing'); + } else if (displayPlayMethod === 'DirectStream') { html += globalize.translate('DirectStreaming'); } else if (displayPlayMethod === 'Transcode') { html += globalize.translate('Transcoding'); @@ -435,7 +444,7 @@ import 'emby-itemscontainer'; } if (line.length) { - html += ' - ' + line.join(' '); + html += '

' + line.join(' '); } } diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 213329f9d0..f4f111a096 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -164,8 +164,8 @@ "DetectingDevices": "Detecting devices", "DeviceAccessHelp": "This only applies to devices that can be uniquely identified and will not prevent browser access. Filtering user device access will prevent them from using new devices until they've been approved here.", "DirectPlaying": "Direct playing", - "DirectStreamHelp1": "The media is compatible with the device regarding resolution and media type (H.264, AC3, etc), but in an incompatible file container (mkv, avi, wmv, etc). The video will be re-packaged on the fly before being sent to the device.", - "DirectStreamHelp2": "Direct stream uses very little processing power with a minimal loss in video quality.", + "DirectStreamHelp1": "The media is in an incompatible file container (mkv, avi, wmv, etc) and the video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or audio channels (5.1, 7.1, etc). The video stream will be re-packaged losslessly on the fly before being sent to the device. Only audio stream will be transcoded.", + "DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.", "DirectStreaming": "Direct streaming", "Director": "Director", "Directors": "Directors", @@ -1430,5 +1430,16 @@ "SubtitleVerticalPositionHelp": "Line number where text appears. Positive numbers indicate top down. Negative numbers indicate bottom up.", "Preview": "Preview", "LabelMaxMuxingQueueSize": "Max muxing queue size:", - "LabelMaxMuxingQueueSizeHelp": "Maximum number of packets that can be buffered while waiting for all streams to initialize. Try to increase it if you still encounter \"Too many packets buffered for output stream\" error in ffmpeg logs. The recommended value is 2048." + "LabelMaxMuxingQueueSizeHelp": "Maximum number of packets that can be buffered while waiting for all streams to initialize. Try to increase it if you still encounter \"Too many packets buffered for output stream\" error in ffmpeg logs. The recommended value is 2048.", + "Remuxing": "Remuxing", + "RemuxHelp1": "The media is in an incompatible file container (mkv, avi, wmv, etc). But both video stream and audio stream are compatible with the device. The media will be re-packaged losslessly on the fly before being sent to the device.", + "RemuxHelp2": "Remux uses very little processing power with a completely lossless media quality.", + "LabelPlaybackInfo": "Playback Info", + "LabelAudioInfo": "Audio Info", + "LabelVideoInfo": "Video Info", + "LabelTranscodingInfo": "Transcoding Info", + "LabelDirectStreamingInfo": "Direct Streaming Info", + "LabelRemuxingInfo": "Remuxing Info", + "LabelOriginalMediaInfo": "Original Media Info", + "LabelSyncPlayInfo": "SyncPlay Info" } diff --git a/src/strings/zh-cn.json b/src/strings/zh-cn.json index a59866de3b..e93d78cfa4 100644 --- a/src/strings/zh-cn.json +++ b/src/strings/zh-cn.json @@ -128,7 +128,7 @@ "DetectingDevices": "正在侦测设备", "DeviceAccessHelp": "这仅适用于可以唯一标识的设备,而不会阻止浏览器访问。限制用户设备访问会阻止使用未在此被批准的新增设备。", "DirectPlaying": "直接播放", - "DirectStreamHelp2": "直接串流只占用占用很少的CPU并且视频的品质只会有极小程度的损失。", + "DirectStreamHelp2": "直接串流占用的 CPU 资源通常取决于音频规格。只有视频流是无损的。", "DirectStreaming": "直接串流", "Director": "导演", "Disc": "光盘", @@ -1142,7 +1142,7 @@ "ErrorDeletingItem": "从服务器删除项目时出错。请检查Jellyfin是否拥有对媒体目录的写权限,然后重试。", "GroupBySeries": "按系列分组", "HeaderApp": "应用程序", - "DirectStreamHelp1": "该媒体文件的分辨率和编码(H.264、AC3 等)与您的设备兼容,但文件格式(.mkv、.avi、.wmv 等)不受支持。因此,视频在串流至您的设备之前将会被即时封装为另一种格式。", + "DirectStreamHelp1": "该媒体的载体(mkv、avi、wmv 等)不被设备支持,视频流在与您的设备兼容,但是音频流有着不被设备支持的媒体格式(DTS、TRUEHD 等)或声道数量(5.1、7.1 等)。因此视频流在串流至您的设备之前将被即时无损地再封装。只有音频流将被转码。", "HeaderAppearsOn": "同时出现于", "HeaderCancelSeries": "取消系列", "HeaderKeepRecording": "继续录制", @@ -1431,5 +1431,16 @@ "OptionAllowContentDownload": "允许媒体下载", "HeaderDeleteDevices": "删除所有设备", "DeleteDevicesConfirmation": "您确定要删除所有设备吗?所有其他会话将被注销。用户下次登录时,设备会重新出现。", - "DeleteAll": "删除全部" + "DeleteAll": "删除全部", + "Remuxing": "转封装", + "RemuxHelp1": "该媒体的载体(mkv、avi、wmv 等)不被设备支持,但视频流和音频流均与您的设备兼容,因此媒体在串流至您的设备之前将被即时无损地再封装。", + "RemuxHelp2": "转封装只占用很少的 CPU 资源并且媒体将被完全无损地传输。", + "LabelPlaybackInfo": "播放信息", + "LabelAudioInfo": "音频信息", + "LabelVideoInfo": "视频信息", + "LabelTranscodingInfo": "转码信息", + "LabelDirectStreamingInfo": "直接串流信息", + "LabelRemuxingInfo": "转封装信息", + "LabelOriginalMediaInfo": "媒体源信息", + "LabelSyncPlayInfo": "同步播放信息" } From 1cf3b0e75666247cb3cb315346f3f692caf5242b Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Tue, 17 Nov 2020 23:57:07 +0800 Subject: [PATCH 2/6] localize playback stats --- src/components/playerstats/playerstats.js | 14 +++++++------- src/controllers/dashboard/dashboard.js | 2 -- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/playerstats/playerstats.js b/src/components/playerstats/playerstats.js index 354002a267..593320047a 100644 --- a/src/components/playerstats/playerstats.js +++ b/src/components/playerstats/playerstats.js @@ -385,12 +385,12 @@ import 'css!./playerstats'; const baseCategory = { stats: [], - name: 'Playback Info' + name: globalize.translate('LabelPlaybackInfo') }; baseCategory.stats.unshift({ label: globalize.translate('LabelPlayMethod'), - value: displayPlayMethod + value: localizedDisplayMethod }); baseCategory.stats.unshift({ @@ -405,9 +405,9 @@ import 'css!./playerstats'; for (let i = 0, length = playerStats.length; i < length; i++) { const category = playerStats[i]; if (category.type === 'audio') { - category.name = 'Audio Info'; + category.name = globalize.translate('LabelAudioInfo'); } else if (category.type === 'video') { - category.name = 'Video Info'; + category.name = globalize.translate('LabelVideoInfo'); } categories.push(category); } @@ -422,20 +422,20 @@ import 'css!./playerstats'; if (session.TranscodingInfo) { categories.push({ stats: getTranscodingStats(session, player, displayPlayMethod), - name: displayPlayMethod === 'Transcode' ? 'Transcoding Info' : 'Direct Stream Info' + name: localizedTranscodingInfo }); } categories.push({ stats: getMediaSourceStats(session, player), - name: 'Original Media Info' + name: globalize.translate('LabelOriginalMediaInfo') }); const apiClient = window.connectionManager.getApiClient(playbackManager.currentItem(player).ServerId); if (syncPlayManager.isSyncPlayEnabled() && apiClient.isMinServerVersion('10.6.0')) { categories.push({ stats: getSyncPlayStats(), - name: 'SyncPlay Info' + name: globalize.translate('LabelSyncPlayInfo') }); } diff --git a/src/controllers/dashboard/dashboard.js b/src/controllers/dashboard/dashboard.js index d5dcf9ca49..9e5740bb8b 100644 --- a/src/controllers/dashboard/dashboard.js +++ b/src/controllers/dashboard/dashboard.js @@ -414,8 +414,6 @@ import 'emby-itemscontainer'; } showTranscodingInfo = true; - } else if (displayPlayMethod === 'DirectPlay') { - html += globalize.translate('DirectPlaying'); } if (showTranscodingInfo) { From 87965aa7a46dd39f82fb71bf190ded4c99bc168a Mon Sep 17 00:00:00 2001 From: Nyanmisaka Date: Wed, 18 Nov 2020 05:39:17 +0000 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: dkanada --- src/strings/en-us.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strings/en-us.json b/src/strings/en-us.json index f4f111a096..87dea5f1d0 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -164,7 +164,7 @@ "DetectingDevices": "Detecting devices", "DeviceAccessHelp": "This only applies to devices that can be uniquely identified and will not prevent browser access. Filtering user device access will prevent them from using new devices until they've been approved here.", "DirectPlaying": "Direct playing", - "DirectStreamHelp1": "The media is in an incompatible file container (mkv, avi, wmv, etc) and the video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or audio channels (5.1, 7.1, etc). The video stream will be re-packaged losslessly on the fly before being sent to the device. Only audio stream will be transcoded.", + "DirectStreamHelp1": "The media is in an incompatible file container (MKV, AVI, WMV, etc) and the video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.", "DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.", "DirectStreaming": "Direct streaming", "Director": "Director", @@ -1432,7 +1432,7 @@ "LabelMaxMuxingQueueSize": "Max muxing queue size:", "LabelMaxMuxingQueueSizeHelp": "Maximum number of packets that can be buffered while waiting for all streams to initialize. Try to increase it if you still encounter \"Too many packets buffered for output stream\" error in ffmpeg logs. The recommended value is 2048.", "Remuxing": "Remuxing", - "RemuxHelp1": "The media is in an incompatible file container (mkv, avi, wmv, etc). But both video stream and audio stream are compatible with the device. The media will be re-packaged losslessly on the fly before being sent to the device.", + "RemuxHelp1": "The media is in an incompatible file container (MKV, AVI, WMV, etc) but both the video stream and audio stream are compatible with the device. The media will be repackaged losslessly on the fly before being sent to the device.", "RemuxHelp2": "Remux uses very little processing power with a completely lossless media quality.", "LabelPlaybackInfo": "Playback Info", "LabelAudioInfo": "Audio Info", From c636386bc07b35e5eb8904697df8d5f8964786f6 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Wed, 18 Nov 2020 13:41:58 +0800 Subject: [PATCH 4/6] minor changes for Directstream --- src/strings/en-us.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 87dea5f1d0..2297934f0d 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -164,7 +164,7 @@ "DetectingDevices": "Detecting devices", "DeviceAccessHelp": "This only applies to devices that can be uniquely identified and will not prevent browser access. Filtering user device access will prevent them from using new devices until they've been approved here.", "DirectPlaying": "Direct playing", - "DirectStreamHelp1": "The media is in an incompatible file container (MKV, AVI, WMV, etc) and the video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.", + "DirectStreamHelp1": "The video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.", "DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.", "DirectStreaming": "Direct streaming", "Director": "Director", From f3c9b9da15a0f8a0325b94c6a155fd7ad8f5ef5f Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Fri, 20 Nov 2020 12:21:55 +0800 Subject: [PATCH 5/6] use uppercase for codecs in dashboard --- src/controllers/dashboard/dashboard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/dashboard/dashboard.js b/src/controllers/dashboard/dashboard.js index 57436f7537..2bfecee080 100644 --- a/src/controllers/dashboard/dashboard.js +++ b/src/controllers/dashboard/dashboard.js @@ -431,15 +431,15 @@ import confirm from '../../components/confirm/confirm'; } if (session.TranscodingInfo.Container) { - line.push(session.TranscodingInfo.Container); + line.push(session.TranscodingInfo.Container.toUpperCase()); } if (session.TranscodingInfo.VideoCodec) { - line.push(session.TranscodingInfo.VideoCodec); + line.push(session.TranscodingInfo.VideoCodec.toUpperCase()); } if (session.TranscodingInfo.AudioCodec && session.TranscodingInfo.AudioCodec != session.TranscodingInfo.Container) { - line.push(session.TranscodingInfo.AudioCodec); + line.push(session.TranscodingInfo.AudioCodec.toUpperCase()); } } From fd3c6ad55313bc4640d7adcbc6470cf5685a201f Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sat, 21 Nov 2020 12:47:43 +0800 Subject: [PATCH 6/6] resolve confict --- src/strings/zh-cn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings/zh-cn.json b/src/strings/zh-cn.json index d9f79bb091..ff10f7c3af 100644 --- a/src/strings/zh-cn.json +++ b/src/strings/zh-cn.json @@ -1443,7 +1443,7 @@ "LabelDirectStreamingInfo": "直接串流信息", "LabelRemuxingInfo": "转封装信息", "LabelOriginalMediaInfo": "媒体源信息", - "LabelSyncPlayInfo": "同步播放信息" + "LabelSyncPlayInfo": "同步播放信息", "PreferFmp4HlsContainer": "优先使用 fMP4-HLS 媒体容器", "PreferFmp4HlsContainerHelp": "优先使用 fMP4 作为 HLS 播放的默认容器,从而可以在支持的设备上直接串流 HEVC 格式的内容。", "AllowHevcEncoding": "允许以 HEVC 格式编码",