GenerativeAiResult::toVideoFile(): WordPressAiClientFilesDTOFile

In this article

Converts the first candidate to a video file.

Return

WordPressAiClientFilesDTOFile The video file.

Source

public function toVideoFile(): File
{
    $file = $this->toFile();
    if (!$file->isVideo()) {
        throw new RuntimeException(sprintf('File is not a video file. MIME type: %s', $file->getMimeType()));
    }
    return $file;
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.