Methods
Constructor, used to input the data
__construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null)
For documentation on all the parameters, see the corresponding
properties and their accessors
Parameters
$link
$type
$length
$javascript
$bitrate
$captions
$categories
$channels
$copyright
$credits
$description
$duration
$expression
$framerate
$hashes
$height
$keywords
$lang
$medium
$player
$ratings
$restrictions
$samplingrate
$thumbnails
$title
$width
String-ified version
__toString() : string
Embed the enclosure using Javascript
embed(array|string $options = '', boolean $native = false) : string
$options is an array or comma-separated key:value string, with the
following properties:
alt (string): Alternate content for when an end-user does not have
the appropriate handler installed or when a file type is
unsupported. Can be any text or HTML. Defaults to blank.
altclass (string): If a file type is unsupported, the end-user will
see the alt text (above) linked directly to the content. That link
will have this value as its class name. Defaults to blank.
audio (string): This is an image that should be used as a
placeholder for audio files before they're loaded (QuickTime-only).
Can be any relative or absolute URL. Defaults to blank.
bgcolor (string): The background color for the media, if not
already transparent. Defaults to #ffffff.
height (integer): The height of the embedded media. Accepts any
numeric pixel value (such as 360) or auto. Defaults to auto,
and it is recommended that you use this default.
loop (boolean): Do you want the media to loop when its done?
Defaults to false.
mediaplayer (string): The location of the included
mediaplayer.swf file. This allows for the playback of Flash Video
(.flv) files, and is the default handler for non-Odeo MP3's.
Defaults to blank.
video (string): This is an image that should be used as a
placeholder for video files before they're loaded (QuickTime-only).
Can be any relative or absolute URL. Defaults to blank.
width (integer): The width of the embedded media. Accepts any
numeric pixel value (such as 480) or auto. Defaults to auto,
and it is recommended that you use this default.
widescreen (boolean): Is the enclosure widescreen or standard?
This applies only to video enclosures, and will automatically resize
the content appropriately. Defaults to false, implying 4:3 mode.
Note: Non-widescreen (4:3) mode with width and height set to auto
will default to 480x360 video resolution. Widescreen (16:9) mode with
width and height set to auto will default to 480x270 video resolution.
| todo |
If the dimensions for media:content are defined, use them when width/height are set to 'auto'. |
Parameters
$options
arraystringComma-separated key:value list, or array
Returns
stringHTML string to output
Get the bitrate
get_bitrate() : string | null
Get a single caption
get_caption(integer $key = 0) : \SimplePie_Caption | null
Parameters
$key
integer
Returns
\SimplePie_Captionnull
Get all captions
get_captions() : array | null
Returns
arraynullArray of {@see SimplePie_Caption} objects
Get all categories
get_categories() : array | null
Returns
arraynullArray of {@see SimplePie_Category} objects
Get a single category
get_category(integer $key = 0) : \SimplePie_Category | null
Parameters
$key
integer
Returns
\SimplePie_Categorynull
Get the number of audio channels
get_channels() : integer | null
Get the copyright information
get_copyright() : \SimplePie_Copyright | null
Returns
\SimplePie_Copyrightnull
Get a single credit
get_credit(integer $key = 0) : \SimplePie_Credit | null
Parameters
$key
integer
Returns
\SimplePie_Creditnull
Get all credits
get_credits() : array | null
Returns
arraynullArray of {@see SimplePie_Credit} objects
Get the description of the enclosure
get_description() : string | null
Get the duration of the enclosure
get_duration(string $convert = false) : string | integer | null
Parameters
$convert
stringConvert seconds into hh:mm:ss
Returns
stringintegernull'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found)
Get the expression
get_expression() : string
Returns
stringProbably one of 'sample', 'full', 'nonstop', 'clip'. Defaults to 'full'
Get the file extension
get_extension() : string | null
Get the framerate (in frames-per-second)
get_framerate() : string | null
Get the preferred handler
get_handler() : string | null
Returns
stringnullOne of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3'
Get a single hash
get_hash(integer $key = 0) : string | null
Parameters
$key
integer
Returns
stringnullHash as per `media:hash`, prefixed with "$algo:"
Get all credits
get_hashes() : array | null
Returns
arraynullArray of strings, see {@see get_hash()}
Get the height
get_height() : string | null
Get a single keyword
get_keyword(integer $key = 0) : string | null
Parameters
$key
integer
Returns
stringnull
Get all keywords
get_keywords() : array | null
Returns
arraynullArray of strings
Get the language
get_language() : string | null
Returns
stringnullLanguage code as per RFC 3066
Get length
get_length() : float
Returns
floatLength in bytes
Get the URL
get_link() : string | null
Get the medium
get_medium() : string | null
Returns
stringnullShould be one of 'image', 'audio', 'video', 'document', 'executable'
Get the player URL
get_player() : string | null
Returns
stringnullPlayer URL
Get a single rating
get_rating(integer $key = 0) : \SimplePie_Rating | null
Parameters
$key
integer
Returns
\SimplePie_Ratingnull
Get all ratings
get_ratings() : array | null
Returns
arraynullArray of {@see SimplePie_Rating} objects
Get the real media type
get_real_type(boolean $find_handler = false) : string
Often, feeds lie to us, necessitating a bit of deeper inspection. This
converts types to their canonical representations based on the file
extension
Parameters
$find_handler
booleanInternal use only, use {@see get_handler()} instead
Returns
stringMIME type
Get a single restriction
get_restriction(integer $key = 0) : \SimplePie_Restriction | null
Parameters
$key
integer
Returns
\SimplePie_Restrictionnull
Get all restrictions
get_restrictions() : array | null
Returns
arraynullArray of {@see SimplePie_Restriction} objects
Get the sampling rate (in kHz)
get_sampling_rate() : string | null
Get the file size (in MiB)
get_size() : float | null
Returns
floatnullFile size in mebibytes (1048 bytes)
Get a single thumbnail
get_thumbnail(integer $key = 0) : string | null
Parameters
$key
integer
Returns
stringnullThumbnail URL
Get all thumbnails
get_thumbnails() : array | null
Returns
arraynullArray of thumbnail URLs
Get the title
get_title() : string | null
Get mimetype of the enclosure
get_type() : string | null
Returns
stringnullMIME type
Get the width
get_width() : string | null
Embed the enclosure using `<embed>`
native_embed(array|string $options = '') : string
| deprecated |
Use the second parameter to {@see embed} instead |
Parameters
$options
arraystringSee first paramter to {@see embed}
Returns
stringHTML string to output
Properties
$bitrate
$bitrate : string
$captions
$captions : array
$categories
$categories : array
$channels
$channels : integer
$copyright
$copyright : \SimplePie_Copyright
$credits
$credits : array
$description
$description : string
$duration
$duration : integer
$expression
$expression : string
$framerate
$framerate : string
$handler
$handler : string
$javascript
$javascript : null
$keywords
$keywords : array
$ratings
$ratings : array
$restrictions
$restrictions : array
$samplingrate
$samplingrate : string
$thumbnails
$thumbnails : array