Files
shaka-player/test/util/drm_utils_unit.js
T
Wojciech Tyczyński d5b1863157 fix: Fix green screen issue on Edge with mixed content (#6719)
On Edge, to properly play mixed content, we need to insert init segment twice for clear part - once as encrypted, and immediately again as clear. Otherwise we may encounter green screen and errors from video decoder.

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
Co-authored-by: Nick Michael <nick-michael@users.noreply.github.com>
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Co-authored-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
2024-06-07 13:06:13 -07:00

46 lines
1.6 KiB
JavaScript

/*! @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
describe('DrmUtils', () => {
describe('isPlayReadyKeySystem', () => {
it('should return true for MS & Chromecast PlayReady', () => {
expect(shaka.util.DrmUtils.isPlayReadyKeySystem(
'com.microsoft.playready')).toBe(true);
expect(shaka.util.DrmUtils.isPlayReadyKeySystem(
'com.microsoft.playready.anything')).toBe(true);
expect(shaka.util.DrmUtils.isPlayReadyKeySystem(
'com.chromecast.playready')).toBe(true);
});
it('should return false for non-PlayReady key systems', () => {
expect(shaka.util.DrmUtils.isPlayReadyKeySystem(
'com.widevine.alpha')).toBe(false);
expect(shaka.util.DrmUtils.isPlayReadyKeySystem(
'com.abc.playready')).toBe(false);
});
});
describe('isFairPlayKeySystem', () => {
it('should return true for FairPlay', () => {
expect(shaka.util.DrmUtils.isFairPlayKeySystem(
'com.apple.fps')).toBe(true);
expect(shaka.util.DrmUtils.isFairPlayKeySystem(
'com.apple.fps.1_0')).toBe(true);
expect(shaka.util.DrmUtils.isFairPlayKeySystem(
'com.apple.fps.2_0')).toBe(true);
expect(shaka.util.DrmUtils.isFairPlayKeySystem(
'com.apple.fps.3_0')).toBe(true);
});
it('should return false for non-FairPlay key systems', () => {
expect(shaka.util.DrmUtils.isFairPlayKeySystem(
'com.widevine.alpha')).toBe(false);
expect(shaka.util.DrmUtils.isFairPlayKeySystem(
'com.abc.playready')).toBe(false);
});
});
});