@@ -119,6 +119,14 @@ export function getFullMIMEString(info) {
119119 // TODO: vorbis.
120120 // TODO: opus.
121121 default :
122+ switch ( stream . codec_name ) {
123+ case 'aac' : codecFrags . add ( getMP4ACodecString ( stream ) ) ; break ;
124+ default :
125+ throw `Could not handle codec_name ${ stream . codec_name } , ` +
126+ `codec_tag_string ${ stream . codec_tag_string } for file ${ info . filename } yet. ` +
127+ `Please file a bug https://github.com/codedread/bitjs/issues/new` ;
128+ }
129+ break ;
122130 }
123131 }
124132 else if ( stream . codec_type === 'video' ) {
@@ -130,8 +138,14 @@ export function getFullMIMEString(info) {
130138 case 'mjpeg' :
131139 continue ;
132140 default :
133- throw `Could not handle codec_tag_string ${ stream . codec_tag_string } yet. ` +
134- `Please file a bug https://github.com/codedread/bitjs/issues/new` ;
141+ switch ( stream . codec_name ) {
142+ case 'h264' : codecFrags . add ( getAVC1CodecString ( stream ) ) ; break ;
143+ default :
144+ throw `Could not handle codec_name ${ stream . codec_name } , ` +
145+ `codec_tag_string ${ stream . codec_tag_string } for file ${ info . filename } yet. ` +
146+ `Please file a bug https://github.com/codedread/bitjs/issues/new` ;
147+
148+ }
135149 }
136150 }
137151 }
@@ -143,6 +157,7 @@ export function getFullMIMEString(info) {
143157// TODO: Consider whether any of these should be exported.
144158
145159/**
160+ * AVC1 is the same thing as H264.
146161 * https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter#iso_base_media_file_format_mp4_quicktime_and_3gp
147162 * @param {ProbeStream } stream
148163 * @returns {string }
@@ -237,6 +252,7 @@ function getVP09CodecString(stream) {
237252}
238253
239254/**
255+ * MP4A is the same as AAC.
240256 * https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter#mp4a
241257 * @param {ProbeStream } stream
242258 * @returns {string }
@@ -248,7 +264,7 @@ function getMP4ACodecString(stream) {
248264 frag += '.2' ;
249265 break ;
250266 // TODO: more!
251- default :
267+ default :
252268 throw `Cannot handle AAC stream with profile ${ stream . profile } yet. ` +
253269 `Please file a bug https://github.com/codedread/bitjs/issues/new` ;
254270 }
0 commit comments