DynamicHLSPlaylist
in package
implements
Responsable
Table of Contents
Interfaces
- Responsable
Properties
- $disk : Disk
- $keyCache : array<string|int, mixed>
- $keyResolver : callable
- Callable to retrieve the path to the given key.
- $media : Media
- $mediaCache : array<string|int, mixed>
- $mediaResolver : callable
- Callable to retrieve the path to the given media.
- $playlistCache : array<string|int, mixed>
Methods
- __construct() : mixed
- Uses the 'filesystems.default' disk as default.
- all() : Collection
- Returns a collection of all processed segment playlists and the processed main playlist.
- fromDisk() : self
- Set the disk to open files from.
- get() : string
- Returns the processed content of the playlist.
- getProcessedPlaylist() : string
- Processes the given playlist.
- open() : self
- Instantiates a Media object for the given path and clears the cache.
- parseLines() : Collection
- Parses the lines into a Collection
- setKeyUrlResolver() : self
- setMediaUrlResolver() : self
- setPlaylistUrlResolver() : self
- toResponse() : mixed
- extractKeyFromExtLine() : string|null
- Returns the filename of the encryption key.
- lineHasMediaFilename() : bool
- Returns a boolean wether the line contains a .M3U8 playlist filename or a .TS segment filename.
- resolveKeyFilename() : string
- Returns the resolved key filename from the cache or resolves it.
- resolveMediaFilename() : string
- Returns the resolved media filename from the cache or resolves it.
- resolvePlaylistFilename() : string
- Returns the resolved playlist filename from the cache or resolves it.
Properties
$disk
private
Disk
$disk
$keyCache
private
array<string|int, mixed>
$keyCache
= []
$keyResolver
Callable to retrieve the path to the given key.
private
callable
$keyResolver
$media
private
Media
$media
$mediaCache
private
array<string|int, mixed>
$mediaCache
= []
$mediaResolver
Callable to retrieve the path to the given media.
private
callable
$mediaResolver
$playlistCache
private
array<string|int, mixed>
$playlistCache
= []
Methods
__construct()
Uses the 'filesystems.default' disk as default.
public
__construct([mixed $disk = null ]) : mixed
Parameters
- $disk : mixed = null
all()
Returns a collection of all processed segment playlists and the processed main playlist.
public
all() : Collection
Return values
CollectionfromDisk()
Set the disk to open files from.
public
fromDisk(mixed $disk) : self
Parameters
- $disk : mixed
Return values
selfget()
Returns the processed content of the playlist.
public
get() : string
Return values
stringgetProcessedPlaylist()
Processes the given playlist.
public
getProcessedPlaylist(string $playlistPath) : string
Parameters
- $playlistPath : string
Return values
stringopen()
Instantiates a Media object for the given path and clears the cache.
public
open(string $path) : self
Parameters
- $path : string
Return values
selfparseLines()
Parses the lines into a Collection
public
static parseLines(string $lines) : Collection
Parameters
- $lines : string
Return values
CollectionsetKeyUrlResolver()
public
setKeyUrlResolver(callable $keyResolver) : self
Parameters
- $keyResolver : callable
Return values
selfsetMediaUrlResolver()
public
setMediaUrlResolver(callable $mediaResolver) : self
Parameters
- $mediaResolver : callable
Return values
selfsetPlaylistUrlResolver()
public
setPlaylistUrlResolver(callable $playlistResolver) : self
Parameters
- $playlistResolver : callable
Return values
selftoResponse()
public
toResponse(mixed $request) : mixed
Parameters
- $request : mixed
extractKeyFromExtLine()
Returns the filename of the encryption key.
private
static extractKeyFromExtLine(string $line) : string|null
Parameters
- $line : string
Return values
string|nulllineHasMediaFilename()
Returns a boolean wether the line contains a .M3U8 playlist filename or a .TS segment filename.
private
static lineHasMediaFilename(string $line) : bool
Parameters
- $line : string
Return values
boolresolveKeyFilename()
Returns the resolved key filename from the cache or resolves it.
private
resolveKeyFilename(string $key) : string
Parameters
- $key : string
Return values
stringresolveMediaFilename()
Returns the resolved media filename from the cache or resolves it.
private
resolveMediaFilename(string $media) : string
Parameters
- $media : string
Return values
stringresolvePlaylistFilename()
Returns the resolved playlist filename from the cache or resolves it.
private
resolvePlaylistFilename(string $playlist) : string
Parameters
- $playlist : string