Blame view

node_modules/videojs-contrib-media-sources/test/codec-utils.test.js 1.12 KB
2a09d1a4   liuqimichale   添加宜春 天水 宣化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  import Qunit from 'qunit';
  import { translateLegacyCodecs } from '../src/codec-utils';
  
  const { deepEqual, module, test } = Qunit;
  
  module('Codec Utils');
  
  test('translates legacy codecs', function() {
    deepEqual(translateLegacyCodecs(['avc1.66.30', 'avc1.66.30']),
              ['avc1.42001e', 'avc1.42001e'],
              'translates legacy avc1.66.30 codec');
  
    deepEqual(translateLegacyCodecs(['avc1.42C01E', 'avc1.42C01E']),
              ['avc1.42C01E', 'avc1.42C01E'],
              'does not translate modern codecs');
  
    deepEqual(translateLegacyCodecs(['avc1.42C01E', 'avc1.66.30']),
              ['avc1.42C01E', 'avc1.42001e'],
              'only translates legacy codecs when mixed');
  
    deepEqual(translateLegacyCodecs(['avc1.4d0020', 'avc1.100.41', 'avc1.77.41',
                                     'avc1.77.32', 'avc1.77.31', 'avc1.77.30',
                                     'avc1.66.30', 'avc1.66.21', 'avc1.42C01e']),
              ['avc1.4d0020', 'avc1.640029', 'avc1.4d0029',
               'avc1.4d0020', 'avc1.4d001f', 'avc1.4d001e',
               'avc1.42001e', 'avc1.420015', 'avc1.42C01e'],
              'translates a whole bunch');
  });