Heratio Framework API Reference

MediaHelper
in package

Media Helper - Enhanced media player with transcription support

Handles streaming for legacy formats that browsers cannot play natively

Table of Contents

Methods

buildStreamingUrl()  : string
Build streaming URL for a digital object
extensionNeedsStreaming()  : bool
Check if file extension needs streaming
formatDuration()  : string
Format duration as HH:MM:SS
getMediaDuration()  : float|null
Get media duration using FFprobe
getOutputMimeType()  : string
Get the output MIME type for transcoding
getStreamingExtensions()  : array<string|int, mixed>
File extensions that need streaming
getStreamingMimeTypes()  : array<string|int, mixed>
MIME types that need FFmpeg streaming/transcoding
isFFmpegAvailable()  : bool
Check if FFmpeg is available
needsStreaming()  : bool
Check if MIME type needs streaming

Methods

buildStreamingUrl()

Build streaming URL for a digital object

public static buildStreamingUrl(int $digitalObjectId[, string $baseUrl = '' ]) : string
Parameters
$digitalObjectId : int
$baseUrl : string = ''
Return values
string

extensionNeedsStreaming()

Check if file extension needs streaming

public static extensionNeedsStreaming(string $extension) : bool
Parameters
$extension : string
Return values
bool

formatDuration()

Format duration as HH:MM:SS

public static formatDuration(float $seconds) : string
Parameters
$seconds : float
Return values
string

getMediaDuration()

Get media duration using FFprobe

public static getMediaDuration(string $filePath) : float|null
Parameters
$filePath : string
Return values
float|null

getOutputMimeType()

Get the output MIME type for transcoding

public static getOutputMimeType(string $inputMimeType) : string
Parameters
$inputMimeType : string
Return values
string

getStreamingExtensions()

File extensions that need streaming

public static getStreamingExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getStreamingMimeTypes()

MIME types that need FFmpeg streaming/transcoding

public static getStreamingMimeTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

isFFmpegAvailable()

Check if FFmpeg is available

public static isFFmpegAvailable() : bool
Return values
bool

needsStreaming()

Check if MIME type needs streaming

public static needsStreaming(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

        
On this page

Search results