How to use @videojs/vhs-utils - 1 common examples

To help you get started, we’ve selected a few @videojs/vhs-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github videojs / m3u8-parser / src / parser.js View on Github external
message: 'invalid key ID provided for Widevine'
                  });
                  return;
                }

                // if Widevine key attributes are valid, store them as `contentProtection`
                // on the manifest to emulate Widevine tag structure in a DASH mpd
                this.manifest.contentProtection = {
                  'com.widevine.alpha': {
                    attributes: {
                      schemeIdUri: entry.attributes.KEYFORMAT,
                      // remove '0x' from the key id string
                      keyId: entry.attributes.KEYID.substring(2)
                    },
                    // decode the base64-encoded PSSH box
                    pssh: decodeB64ToUint8Array(entry.attributes.URI.split(',')[1])
                  }
                };
                return;
              }

              if (!entry.attributes.METHOD) {
                this.trigger('warn', {
                  message: 'defaulting key method to AES-128'
                });
              }

              // setup an encryption key for upcoming segments
              key = {
                method: entry.attributes.METHOD || 'AES-128',
                uri: entry.attributes.URI
              };

@videojs/vhs-utils

Objects and functions shared throughtout @videojs/http-streaming code

MIT
Latest version published 2 years ago

Package Health Score

77 / 100
Full package analysis

Popular @videojs/vhs-utils functions