onWebkitNeedKey_(event) {
    shaka.log.debug('PatchedMediaKeysWebkit.onWebkitNeedKey_', event);
    goog.asserts.assert(this.media_, 'media_ not set in onWebkitNeedKey_');

    const event2 = new CustomEvent('encrypted');
    const encryptedEvent =
      /** @type {!MediaEncryptedEvent} */(/** @type {?} */(event2));
    // initDataType is not used by v0.1b EME, so any valid value is fine here.
    encryptedEvent.initDataType = 'cenc';
    encryptedEvent.initData = shaka.util.BufferUtils.toArrayBuffer(
        event.initData);

    this.media_.dispatchEvent(event2);
  }
@param {!MediaKeyEvent} event
@suppress {constantProperty} We reassign what would be const on a real
  MediaEncryptedEvent, but in our look-alike event.
@private