コード例 #1
0
 public function parseEntry($entry)
 {
     if (isset($entry['entryId'])) {
         $video = new KalturaVideoObject();
         $video->setID($entry['entryId']);
         $video->setTitle($entry['title']);
         $video->setDescription($entry['description']);
         $ts = $entry['updatedAt'];
         // there is also a 'createdAt' property that could be used instead
         $video->setPublished(new DateTime("@{$ts}"));
         $video->setStillFrameImage($entry['thumbnail']['url']);
         $video->setImage($entry['thumbnailUrl']['url']);
         $video->setDuration($entry['media']['duration'] / 1000);
         // Need to convert to seconds
         $tags = Kurogo::arrayVal($entry, 'tags', array());
         $video->setTags(Kurogo::arrayVal($tags, 'tag', array()));
         // currently an array of tags
         $video->setVideoSources($entry['itemContent']);
         $video->setSubtitleTracks($entry['subTitles']);
         return $video;
     }
 }