Skip to content

Commit d0d9a5b

Browse files
authored
Merge pull request #46 from jophillips90/KalturaAutoCaptionCheck
Adds a check for Auto Generated captions
2 parents 6657ae6 + fa99d11 commit d0d9a5b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Video/Kaltura.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ function captionsLanguage($captions)
5656
return empty($captions) ? self::KALTURA_SUCCESS : self::KALTURA_FAIL;
5757
}
5858

59+
/**
60+
* Checks to see if a video is using auto-generated caption information in Kaltura
61+
* @param array $captions
62+
* @return int
63+
*/
64+
public function captionsAutoGenerated($captions)
65+
{
66+
// Looks through the captions and checks if any were not auto-generated
67+
foreach ($captions as $captionItem) {
68+
if ($captionItem->version > 1) {
69+
return self::KALTURA_SUCCESS;
70+
}
71+
}
72+
73+
return empty($captions) ? self::KALTURA_SUCCESS : self::KALTURA_FAIL;
74+
}
75+
5976
/**
6077
* Checks to see if the provided link URL is a Kaltura video. If so, it returns
6178
* the video code, if not, it returns null.

0 commit comments

Comments
 (0)