Skip to content

Trailers

duck7000 edited this page Aug 8, 2026 · 7 revisions

This describes the working of Trailers class with description of the used method and what data it returns.

Trailers class get info about trailers like IMDb displays on their trailers page: https://www.imdb.com/trailers/ It returns an array of titles

Calling the class

$imdb = new \Imdb\Trailers();
$results = $imdb->recentVideo();

recentVideo()

  • It will return max 100 items (more is not possible)
  • playbackUrl is playable in browser.

@ return Array[] of array
[videoId] => (string or NULL) without vi
[titleId] => (string or NULL) without tt
[title] => (string or NULL) title where this trailer belongs to
[trailerCreateDate] => (string or NULLL) (iso date string) 2024-11-17T13:16:18.708Z
[trailerRuntime] => (int or NULL) In seconds!
[playbackUrl] => (string or NULL) url will playback in browser
[fullPlaybackUrls] => Array() [0] => Array() [url] => string [mimeType] => string MP4 [definition] => string DEF_SD [fullPreviewUrls] => Array() [0] => Array() [url] => string [mimeType] => string M3U8 [definition] => string DEF_AUTO [thumbnailUrl] => (string or NULL) thumbnail (140x207) image url of the title
[releaseDate] => (string or NULL) date string like December 4, 2024
[contentType] => (string or NULL) like Trailer Season 1 [OV]

trendingVideo()

  • It will return max 250 items
  • Note that title is skipped when there is no videoId, so less than 250 items is possible
  • playbackUrl is playable in browser.

@ return Array[] of array
[videoId] => (string or NULL) without vi
[titleId] => (string or NULL) without tt
[title] => (string or NULL) title where this trailer belongs to
[trailerCreateDate] => (string or NULLL) (iso date string) 2024-11-17T13:16:18.708Z
[trailerRuntime] => (int or NULL) In seconds!
[playbackUrl] => (string or NULL) url will playback in browser
[fullPlaybackUrls] => Array() [0] => Array() [url] => string [mimeType] => string MP4 [definition] => string DEF_SD [fullPreviewUrls] => Array() [0] => Array() [url] => string [mimeType] => string M3U8 [definition] => string DEF_AUTO [thumbnailUrl] => (string or NULL) thumbnail (140x207) image url of the title
[releaseDate] => (string or NULL) date string like December 4, 2024
[contentType] => (string or NULL) like Trailer Season 1 [OV]

Clone this wiki locally