Skip to content

Commit

Permalink
Merge pull request #46 from jophillips90/KalturaAutoCaptionCheck
Browse files Browse the repository at this point in the history
Adds a check for Auto Generated captions
  • Loading branch information
cidilabs committed Jan 5, 2023
2 parents 6657ae6 + fa99d11 commit d0d9a5b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Video/Kaltura.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ function captionsLanguage($captions)
return empty($captions) ? self::KALTURA_SUCCESS : self::KALTURA_FAIL;
}

/**
* Checks to see if a video is using auto-generated caption information in Kaltura
* @param array $captions
* @return int
*/
public function captionsAutoGenerated($captions)
{
// Looks through the captions and checks if any were not auto-generated
foreach ($captions as $captionItem) {
if ($captionItem->version > 1) {
return self::KALTURA_SUCCESS;
}
}

return empty($captions) ? self::KALTURA_SUCCESS : self::KALTURA_FAIL;
}

/**
* Checks to see if the provided link URL is a Kaltura video. If so, it returns
* the video code, if not, it returns null.
Expand Down

0 comments on commit d0d9a5b

Please sign in to comment.