class VideoAnnotationFrames implements ValidationRule

Properties

protected float|null $duration

Duration of the video in seconds. Frame times are not checked against the duration if this is null (e.g. because the duration is not known yet).

Methods

__construct(float|null $duration = null)

Create a new instance.

void
validate(string $attribute, mixed $value, Closure $fail)

Run the validation rule.

string|null
getErrorMessage(array $frames)

Get the validation error message for a frames array.

Details

at line 22
__construct(float|null $duration = null)

Create a new instance.

Parameters

float|null $duration

Duration of the video in seconds. Frame times are not checked against the duration if this is null.

at line 30
void validate(string $attribute, mixed $value, Closure $fail)

Run the validation rule.

Parameters

string $attribute
mixed $value
Closure $fail

Return Value

void

at line 52
string|null getErrorMessage(array $frames)

Get the validation error message for a frames array.

This can be used to apply the rule outside of a validator.

Parameters

array $frames

Key frame times, may contain null values to represent gaps in the annotation.

Return Value

string|null

The error message or null if the frames are valid.