Pili\Api::streamSegments PHP Method

streamSegments() public static method

public static streamSegments ( $transport, $streamId, $startTime = NULL, $endTime = NULL, $limit = NULL )
    public static function streamSegments($transport, $streamId, $startTime = NULL, $endTime = NULL, $limit = NULL)
    {
        $url = self::_getApiBaseUrl() . "streams/{$streamId}/segments";
        if (!empty($startTime)) {
            $url .= "?start={$startTime}";
        }
        if (!empty($endTime)) {
            $url .= "&end={$endTime}";
        }
        if (!empty($limit)) {
            $url .= "&limit={$limit}";
        }
        return $transport->send(HttpRequest::GET, $url);
    }

Usage Example

 public function segments($start = NULL, $end = NULL, $limit = NULL)
 {
     return Api::streamSegments($this->_transport, $this->id, $start, $end, $limit);
 }