Appearance
HasStreamMethods
php
trait Zairakai\LaravelTwitch\Services\Concerns\HasStreamMethodsTwitch Stream, Clip, and Video API methods.
Source: src/Services/Concerns/HasStreamMethods.php
Methods
createClip()
php
public function createClip(string $broadcasterId, string $title = null, float $duration = null): ClipEditCreate a clip from a broadcaster's stream.
| Parameter | Description |
|---|---|
$duration | Clip length in seconds, 5-60, precision 0.1. Defaults to 30. |
createClipFromVod()
php
public function createClipFromVod(string $editorId, string $broadcasterId, string $vodId, int $vodOffset, string $title, float $duration = null): ClipEditCreate a clip from a broadcaster's VOD (or the current live stream's in-progress VOD) at a specific offset.
| Parameter | Description |
|---|---|
$editorId | The editor's user ID - same as $broadcasterId when using the broadcaster's own token |
$broadcasterId | The editor's user ID - same as $broadcasterId when using the broadcaster's own token |
$vodOffset | Zero-based offset, in seconds, where the clip ends |
$duration | Clip length in seconds, 5-60, precision 0.1. Defaults to 30. |
createStreamMarker()
php
public function createStreamMarker(string $userId, string $description = null): StreamMarkerAdd a marker to a live stream at the current timestamp.
deleteVideo()
php
public function deleteVideo(string|array $videoIds): arrayDelete one or more videos from a broadcaster's channel.
| Parameter | Description |
|---|---|
$videoIds | Video ID(s) to delete |
Returns array<string> IDs of the deleted videos
getClips()
php
public function getClips(string $broadcasterId, string|array|null $clipIds = null, int $first = 20, string $after = null, string $startedAt = null, string $endedAt = null): PaginatedResultGet clips from a broadcaster's channel.
| Parameter | Description |
|---|---|
$clipIds | Filter by specific clip ID(s) |
Returns PaginatedResult<Clip>
getClipsDownloads()
php
public function getClipsDownloads(string $editorId, string $broadcasterId, string|array $clipIds): DataCollectionGet download URLs for one or more clips.
| Parameter | Description |
|---|---|
$clipIds | One or more clip IDs to download (max 10) |
Returns DataCollection<int, ClipDownload>
getFollowedStreams()
php
public function getFollowedStreams(string $userId, int $first = 20, string $after = null): PaginatedResultGet streams from channels that the authenticated user follows.
Returns PaginatedResult<Stream>
getStreamKey()
php
public function getStreamKey(string $broadcasterId): StreamKeyGet the stream key for the broadcaster's channel.
getStreamMarkers()
php
public function getStreamMarkers(string $userId, string $videoId = null, int $first = 20, string $after = null): PaginatedResultGet stream markers from a VOD or live stream.
Returns PaginatedResult<StreamMarkerGroup>
getStreams()
php
public function getStreams(string|array|null $userIds = null, string|array|null $gameIds = null, string|array|null $languages = null, int $first = 20, string $after = null): PaginatedResultGet information about active streams.
| Parameter | Description |
|---|---|
$userIds | Filter by user ID(s) |
$gameIds | Filter by game ID(s) |
$languages | Filter by language(s) |
Returns PaginatedResult<Stream>
getVideos()
php
public function getVideos(string $userId = null, string $gameId = null, string|array|null $videoIds = null, string $type = 'all', int $first = 20, string $after = null): PaginatedResultGet videos (past broadcasts, highlights, uploads) for a broadcaster.
| Parameter | Description |
|---|---|
$videoIds | Filter by specific video ID(s) |
$type | all, upload, archive, or highlight |
Returns PaginatedResult<Video>