Skip to content

Commit

Permalink
fix(FEC-10562): add wkwebview fairplay support (#497)
Browse files Browse the repository at this point in the history
check environment drm support by `!!window.WebKitMediaKeys`
  • Loading branch information
yairans authored Oct 26, 2020
1 parent 1c71c02 commit 01236c6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/drm/fairplay.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type {FairPlayDrmConfigType} from '../engines/html5/media-source/adapters/fairplay-drm-handler';
import Env from '../../src/utils/env';
import getLogger from '../utils/logger';
import {DrmScheme} from './drm-scheme';

Expand All @@ -26,8 +25,7 @@ const FairPlay: IDrmProtocol = class FairPlay {
*/
static canPlayDrm(drmData: Array<Object>): boolean {
_logger.debug('Can play DRM scheme of: ' + DrmScheme.FAIRPLAY);
const isSafari = Env.browser.name && Env.browser.name.includes('Safari');
return !!drmData.find(drmEntry => drmEntry.scheme === DrmScheme.FAIRPLAY) && isSafari;
return !!drmData.find(drmEntry => drmEntry.scheme === DrmScheme.FAIRPLAY) && !!window.WebKitMediaKeys;
}

/**
Expand Down

0 comments on commit 01236c6

Please sign in to comment.