PSSH

constructor(data: String, strict: Boolean = false)

Create from a Base64-encoded PSSH box, Widevine CENC header, or PlayReady header.

See also

constructor taking ByteArray for how strict is applied.


constructor(data: ByteArray, strict: Boolean = false)

Create from raw bytes of a PSSH box, Widevine CENC header, or PlayReady header.

The input is interpreted in this order:

  1. an ISOBMFF box sequence containing a pssh box;

  2. a bare WidevinePsshData CENC header — accepted only if re-encoding it reproduces the input exactly, since protobuf will happily "parse" many non-protobuf blobs;

  3. a bare PlayReady header or PlayReady Object, detected by a UTF-16LE </WRMHEADER>;

  4. anything else, in lenient mode, is wrapped verbatim as the init_data of a v0 Widevine box. Some services take custom init data (Netflix MSL, for one).

Parameters

strict

reject step 4 with a DecodeException instead of wrapping.


constructor(systemId: ByteArray, version: Int, flags: Int, keyIds: List<Uuid>, content: ByteArray)