@@ -1038,9 +1038,19 @@ var Details = {
10381038 if ( video . VideoDoViTitle || ( video . Title && video . Title . indexOf ( 'Dolby Vision' ) !== - 1 ) ) {
10391039 badges . push ( '<span class="moonfin-badge moonfin-badge-dv">DV</span>' ) ;
10401040 }
1041+
1042+ var videoCodecLabel = this . getCodecBadgeLabel ( video . Codec , 'Video' ) ;
1043+ if ( videoCodecLabel ) {
1044+ badges . push ( '<span class="moonfin-badge moonfin-badge-codec">' + videoCodecLabel + '</span>' ) ;
1045+ }
10411046 }
10421047
10431048 if ( audio ) {
1049+ var audioCodecLabel = this . getCodecBadgeLabel ( audio . Codec , 'Audio' ) ;
1050+ if ( audioCodecLabel ) {
1051+ badges . push ( '<span class="moonfin-badge moonfin-badge-codec">' + audioCodecLabel + '</span>' ) ;
1052+ }
1053+
10441054 if ( ( audio . DisplayTitle && audio . DisplayTitle . indexOf ( 'Atmos' ) !== - 1 ) || ( audio . Profile && audio . Profile . indexOf ( 'Atmos' ) !== - 1 ) ) {
10451055 badges . push ( '<span class="moonfin-badge moonfin-badge-atmos">ATMOS</span>' ) ;
10461056 } else if ( ( audio . DisplayTitle && audio . DisplayTitle . indexOf ( 'DTS:X' ) !== - 1 ) || ( audio . Profile && audio . Profile . indexOf ( 'DTS:X' ) !== - 1 ) ) {
@@ -1054,6 +1064,24 @@ var Details = {
10541064 return badges ;
10551065 } ,
10561066
1067+ getCodecBadgeLabel : function ( codec , streamType ) {
1068+ if ( ! codec ) return '' ;
1069+
1070+ var normalized = String ( codec ) . toUpperCase ( ) ;
1071+
1072+ if ( streamType === 'Video' ) {
1073+ if ( normalized === 'H264' || normalized === 'AVC' ) return 'H.264' ;
1074+ if ( normalized === 'H265' || normalized === 'HEVC' ) return 'HEVC' ;
1075+ }
1076+
1077+ if ( streamType === 'Audio' ) {
1078+ if ( normalized === 'EAC3' ) return 'E-AC3' ;
1079+ if ( normalized === 'TRUEHD' ) return 'TRUEHD' ;
1080+ }
1081+
1082+ return normalized ;
1083+ } ,
1084+
10571085 formatRuntime : function ( ticks ) {
10581086 var minutes = Math . floor ( ticks / 600000000 ) ;
10591087 if ( minutes < 60 ) return minutes + 'm' ;
0 commit comments