Beta version

class YoutubeEmbedFinder extends AbstractEmbedFinder

Youtube tools class.

Manage a youtube video feed

Methods

__construct(string $embedId = '')

AbstractEmbedFinder constructor.

boolean
exists()

Tell if embed media exists after its API feed.

array|bool
getFeed()

Crawl and parse an API json feed for current embedID.

string
getSource(array $options = array())

Get embed media source URL.

string
getMediaFeed(string|bool $search = null)

Crawl an embed API to get a Json feed.

string
getSearchFeed(string $searchTerm, string $author, integer $maxResults = 15)

Crawl an embed API to get a Json feed against a search query.

string
getIFrame(array $options = array())

Compose an HTML iframe for viewing embed media.

createDocumentFromFeed(Container $container)

Create a Document from an embed media

string
getMediaTitle()

Get media title from feed.

string
getMediaDescription()

Get media description from feed.

string
getMediaCopyright()

Get media copyright from feed.

string
getThumbnailURL()

Get media thumbnail external URL from its feed.

StreamInterface|null
downloadFeedFromAPI($url)

Send a CURL request and get its string output.

File|null
downloadThumbnail()

Download a picture from the embed media platform to get a thumbnail.

string
getKey()

Gets the value of key.

setKey(string $key)

Sets the value of key.

Details

in AbstractEmbedFinder at line 64
__construct(string $embedId = '')

AbstractEmbedFinder constructor.

Parameters

string $embedId

at line 48
boolean exists()

Tell if embed media exists after its API feed.

Return Value

boolean

in AbstractEmbedFinder at line 102
array|bool getFeed()

Crawl and parse an API json feed for current embedID.

Return Value

array|bool

at line 149
string getSource(array $options = array())

Get embed media source URL.

Parameters

array $options

Return Value

string

at line 124
string getMediaFeed(string|bool $search = null)

Crawl an embed API to get a Json feed.

Parameters

string|bool $search

Return Value

string

at line 108
string getSearchFeed(string $searchTerm, string $author, integer $maxResults = 15)

Crawl an embed API to get a Json feed against a search query.

Parameters

string $searchTerm
string $author
integer $maxResults

Return Value

string

in AbstractEmbedFinder at line 161
final string getIFrame(array $options = array())

Compose an HTML iframe for viewing embed media.

  • width
  • height
  • title
  • id
  • class

Parameters

array $options

Return Value

string

in AbstractEmbedFinder at line 219
Document createDocumentFromFeed(Container $container)

Create a Document from an embed media

Parameters

Container $container description

Return Value

Document

Exceptions

EntityAlreadyExistsException
RuntimeException

at line 61
string getMediaTitle()

Get media title from feed.

Return Value

string

at line 72
string getMediaDescription()

Get media description from feed.

Return Value

string

at line 83
string getMediaCopyright()

Get media copyright from feed.

Return Value

string

at line 90
string getThumbnailURL()

Get media thumbnail external URL from its feed.

Return Value

string

in AbstractEmbedFinder at line 317
StreamInterface|null downloadFeedFromAPI($url)

Send a CURL request and get its string output.

Parameters

$url

Return Value

StreamInterface|null

Exceptions

RuntimeException

in AbstractEmbedFinder at line 335
File|null downloadThumbnail()

Download a picture from the embed media platform to get a thumbnail.

Return Value

File|null

in AbstractEmbedFinder at line 379
string getKey()

Gets the value of key.

Key is the access_token which could be asked to consume an API. For example, for Youtube it must be your API server key. For Soundcloud it should be you app client Id.

Return Value

string

in AbstractEmbedFinder at line 395
AbstractEmbedFinder setKey(string $key)

Sets the value of key.

Key is the access_token which could be asked to consume an API. For example, for Youtube it must be your API server key. For Soundcloud it should be you app client Id.

Parameters

string $key the key

Return Value

AbstractEmbedFinder