function update($entryId, KalturaLiveStreamAdminEntry $liveStreamEntry) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "liveStreamEntry", $liveStreamEntry->toParams()); $this->client->queueServiceActionCall("livestream", "update", $kparams); if ($this->client->isMultiRequest()) { return null; } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "KalturaLiveStreamAdminEntry"); return $resultObject; }
private function insertLiveStreamEntry(KalturaLiveStreamAdminEntry $liveStreamEntry) { // first validate the input object $liveStreamEntry->validatePropertyNotNull("mediaType"); $liveStreamEntry->validatePropertyNotNull("sourceType"); $liveStreamEntry->validatePropertyNotNull("encodingIP1"); $liveStreamEntry->validatePropertyNotNull("encodingIP2"); $liveStreamEntry->validatePropertyNotNull("streamPassword"); // create a default name if none was given if (!$liveStreamEntry->name) { $liveStreamEntry->name = $this->getPartnerId() . '_' . time(); } // first copy all the properties to the db entry, then we'll check for security stuff $dbEntry = $liveStreamEntry->toObject(new entry()); $this->checkAndSetValidUserInsert($liveStreamEntry, $dbEntry); $this->checkAdminOnlyInsertProperties($liveStreamEntry); $this->validateAccessControlId($liveStreamEntry); $this->validateEntryScheduleDates($liveStreamEntry, $dbEntry); $dbEntry->setPartnerId($this->getPartnerId()); $dbEntry->setSubpId($this->getPartnerId() * 100); $dbEntry->setKuserId($this->getKuser()->getId()); $dbEntry->setCreatorKuserId($this->getKuser()->getId()); $dbEntry->setStatus(entryStatus::IMPORT); $te = new TrackEntry(); $te->setEntryId($dbEntry->getId()); $te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY); $te->setDescription(__METHOD__ . ":" . __LINE__ . "::ENTRY_MEDIA_SOURCE_AKAMAI_LIVE"); TrackEntry::addTrackEntry($te); //if type is manual don't create batch job, just change entry status to ready if ($liveStreamEntry->sourceType == KalturaSourceType::MANUAL_LIVE_STREAM) { $dbEntry->setStatus(entryStatus::READY); $dbEntry->save(); } else { $dbEntry->save(); kJobsManager::addProvisionProvideJob(null, $dbEntry); } return $dbEntry; }