@@ -214,7 +214,7 @@ describe('codecs test suite', () => {
214214 } ) ;
215215 } ) ;
216216
217- describe ( 'VP09' , ( ) => {
217+ describe ( 'VP09 / VP9 ' , ( ) => {
218218 /** @type {ProbeInfo } */
219219 let info ;
220220
@@ -268,6 +268,16 @@ describe('codecs test suite', () => {
268268 } ) ;
269269 } ) ;
270270 } ) ;
271+
272+ it ( 'detects codec_name=vp9 but no codec_tag_string' , ( ) => {
273+ info . streams [ 0 ] . codec_name = 'vp9' ;
274+ info . streams [ 0 ] . codec_tag_string = '[0][0][0][0]' ;
275+ info . streams [ 0 ] . profile = 'Profile 0' ;
276+ info . streams [ 0 ] . level = 21 ; // 0x15
277+ expect ( getFullMIMEString ( info ) )
278+ . to . be . a ( 'string' )
279+ . and . satisfy ( s => s . startsWith ( 'video/webm; codecs="vp09.00.15' ) ) ;
280+ } ) ;
271281 } ) ;
272282
273283 describe ( 'MP4A / AAC' , ( ) => {
@@ -306,4 +316,46 @@ describe('codecs test suite', () => {
306316 . and . equals ( 'audio/mp4; codecs="mp4a.40.2"' ) ;
307317 } ) ;
308318 } ) ;
319+
320+ describe ( 'Vorbis' , ( ) => {
321+ /** @type {ProbeInfo } */
322+ let info ;
323+
324+ beforeEach ( ( ) => {
325+ info = {
326+ format : { format_name : 'matroska,webm' } ,
327+ streams : [ {
328+ codec_type : 'audio' ,
329+ codec_name : 'vorbis' ,
330+ } ] ,
331+ } ;
332+ } ) ;
333+
334+ it ( 'detects vorbis' , ( ) => {
335+ expect ( getFullMIMEString ( info ) )
336+ . to . be . a ( 'string' )
337+ . and . equals ( 'audio/webm; codecs="vorbis"' ) ;
338+ } ) ;
339+ } ) ;
340+
341+ describe ( 'Opus' , ( ) => {
342+ /** @type {ProbeInfo } */
343+ let info ;
344+
345+ beforeEach ( ( ) => {
346+ info = {
347+ format : { format_name : 'matroska,webm' } ,
348+ streams : [ {
349+ codec_type : 'audio' ,
350+ codec_name : 'opus' ,
351+ } ] ,
352+ } ;
353+ } ) ;
354+
355+ it ( 'detects opus' , ( ) => {
356+ expect ( getFullMIMEString ( info ) )
357+ . to . be . a ( 'string' )
358+ . and . equals ( 'audio/webm; codecs="opus"' ) ;
359+ } ) ;
360+ } ) ;
309361} ) ;
0 commit comments