Pili\Api::streamSnapshot PHP Метод

streamSnapshot() публичный статический Метод

public static streamSnapshot ( $transport, $streamId, $name, $format, $time = NULL, $notifyUrl = NULL, $pipeline = NULL )
    public static function streamSnapshot($transport, $streamId, $name, $format, $time = NULL, $notifyUrl = NULL, $pipeline = NULL)
    {
        $url = self::_getApiBaseUrl() . "streams/{$streamId}/snapshot";
        $params = array('name' => $name, 'format' => $format);
        if (!empty($time)) {
            $params['time'] = $time;
        }
        if (!empty($notifyUrl)) {
            $params['notifyUrl'] = $notifyUrl;
        }
        if (!empty($pipeline)) {
            $params['pipeline'] = $pipeline;
        }
        $body = json_encode($params);
        return $transport->send(HttpRequest::POST, $url, $body);
    }

Usage Example

Пример #1
0
 public function snapshot($name, $format, $time = NULL, $notifyUrl = NULL, $pipeline = NULL)
 {
     return Api::streamSnapshot($this->_transport, $this->id, $name, $format, $time, $notifyUrl, $pipeline);
 }