Bånder

EncryptsHLSSegments

Table of Contents

Properties

$encryptionIV  : string
Encryption IV
$encryptionKey  : string
The encryption key.
$encryptionKeyFilename  : string
The encryption key filename.
$encryptionSecretsRoot  : mixed
Disk to store the secrets.
$listener  : StdListener
Listener that will rotate the key.
$nextEncryptionFilenameAndKey  : array<string|int, mixed>
A fresh filename and encryption key for the next round.
$onNewEncryptionKey  : callable
Gets called whenever a new encryption key is set.
$rotateEncryptiongKey  : bool
Wether to rotate the key on every segment.
$segmentsOpened  : int
Number of opened segments.
$segmentsPerKey  : int
Number of segments that can use the same key.

Methods

generateEncryptionKey()  : string
Creates a new encryption key.
generateEncryptionKeyFilename()  : string
Creates a new encryption key filename.
withEncryptionKey()  : HLSExporter|EncryptsHLSSegments
Initialises the disk, info and IV for encryption and sets the key.
withRotatingEncryptionKey()  : HLSExporter|EncryptsHLSSegments
Enables encryption with rotating keys. The callable will receive every new key and the integer sets the number of segments that can use the same key.
addHandlerToRotateEncryptionKey()  : void
Adds a listener and handler to rotate the key on every new HLS segment.
cleanupHLSEncryption()  : HLSExporter|EncryptsHLSSegments
Removes the encryption keys from the temporary disk.
getEncrypedHLSParameters()  : array<string|int, mixed>
Returns an array with the encryption parameters.
removeHandlerThatRotatesEncryptionKey()  : HLSExporter|EncryptsHLSSegments
Remove the listener at the end of the export to prevent duplicate event handlers.
replaceAbsolutePathsHLSEncryption()  : HLSExporter|EncryptsHLSSegments
While encoding, the encryption keys are saved to a temporary directory.
rotateEncryptionKey()  : string
Rotates the key and returns the absolute path to the info file. This method should be executed as fast as possible, or we might be too late for FFmpeg opening the next segment. That's why we don't use the Disk-class magic.

Properties

$encryptionKeyFilename

The encryption key filename.

private string $encryptionKeyFilename

$encryptionSecretsRoot

Disk to store the secrets.

private mixed $encryptionSecretsRoot

$nextEncryptionFilenameAndKey

A fresh filename and encryption key for the next round.

private array<string|int, mixed> $nextEncryptionFilenameAndKey

$onNewEncryptionKey

Gets called whenever a new encryption key is set.

private callable $onNewEncryptionKey

$rotateEncryptiongKey

Wether to rotate the key on every segment.

private bool $rotateEncryptiongKey = false

$segmentsPerKey

Number of segments that can use the same key.

private int $segmentsPerKey = 1

Methods

generateEncryptionKey()

Creates a new encryption key.

public static generateEncryptionKey() : string
Return values
string

generateEncryptionKeyFilename()

Creates a new encryption key filename.

public static generateEncryptionKeyFilename() : string
Return values
string

withRotatingEncryptionKey()

Enables encryption with rotating keys. The callable will receive every new key and the integer sets the number of segments that can use the same key.

public withRotatingEncryptionKey(Closure $callback[, int $segmentsPerKey = 1 ]) : HLSExporter|EncryptsHLSSegments
Parameters
$callback : Closure
$segmentsPerKey : int = 1
Return values
HLSExporter|EncryptsHLSSegments

addHandlerToRotateEncryptionKey()

Adds a listener and handler to rotate the key on every new HLS segment.

private addHandlerToRotateEncryptionKey() : void

getEncrypedHLSParameters()

Returns an array with the encryption parameters.

private getEncrypedHLSParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

replaceAbsolutePathsHLSEncryption()

While encoding, the encryption keys are saved to a temporary directory.

private replaceAbsolutePathsHLSEncryption(Collection $playlistMedia) : HLSExporter|EncryptsHLSSegments

With this method, we loop through all segment playlists and replace the absolute path to the keys to a relative ones.

Parameters
$playlistMedia : Collection
Return values
HLSExporter|EncryptsHLSSegments

rotateEncryptionKey()

Rotates the key and returns the absolute path to the info file. This method should be executed as fast as possible, or we might be too late for FFmpeg opening the next segment. That's why we don't use the Disk-class magic.

private rotateEncryptionKey() : string
Return values
string

        
On this page

Search results