Enclosure
Handles everything related to enclosures (including Media RSS and iTunes RSS)
Used by {@see \SimplePie\Item::get_enclosure()} and {@see \SimplePie\Item::get_enclosures()}
This class can be overloaded with {@see \SimplePie\SimplePie::set_enclosure_class()}
- Full name:
\SimplePie\Enclosure
Properties
bitrate
See Also:
- \SimplePie\get_bitrate() -
captions
See Also:
- \SimplePie\get_captions() -
categories
See Also:
- \SimplePie\get_categories() -
channels
See Also:
- \SimplePie\get_channels() -
copyright
See Also:
- \SimplePie\get_copyright() -
credits
See Also:
- \SimplePie\get_credits() -
description
See Also:
- \SimplePie\get_description() -
duration
See Also:
- \SimplePie\get_duration() -
expression
See Also:
- \SimplePie\get_expression() -
framerate
See Also:
- \SimplePie\get_framerate() -
handler
See Also:
- \SimplePie\get_handler() -
hashes
See Also:
- \SimplePie\get_hashes() -
height
See Also:
- \SimplePie\get_height() -
javascript
- Warning: this property is deprecated. This means that this property will likely be removed in a future version.
keywords
See Also:
- \SimplePie\get_keywords() -
lang
See Also:
- \SimplePie\get_language() -
length
See Also:
- \SimplePie\get_length() -
link
See Also:
- \SimplePie\get_link() -
medium
See Also:
- \SimplePie\get_medium() -
player
See Also:
- \SimplePie\get_player() -
ratings
See Also:
- \SimplePie\get_ratings() -
restrictions
See Also:
- \SimplePie\get_restrictions() -
samplingrate
See Also:
- \SimplePie\get_sampling_rate() -
thumbnails
See Also:
- \SimplePie\get_thumbnails() -
title
See Also:
- \SimplePie\get_title() -
type
See Also:
- \SimplePie\get_type() -
width
See Also:
- \SimplePie\get_width() -
Methods
__construct
Constructor, used to input the data
public __construct(mixed $link = null, mixed $type = null, mixed $length = null, mixed $javascript = null, mixed $bitrate = null, mixed $captions = null, mixed $categories = null, mixed $channels = null, mixed $copyright = null, mixed $credits = null, mixed $description = null, mixed $duration = null, mixed $expression = null, mixed $framerate = null, mixed $hashes = null, mixed $height = null, mixed $keywords = null, mixed $lang = null, mixed $medium = null, mixed $player = null, mixed $ratings = null, mixed $restrictions = null, mixed $samplingrate = null, mixed $thumbnails = null, mixed $title = null, mixed $width = null): mixed
For documentation on all the parameters, see the corresponding properties and their accessors
Parameters:
Parameter | Type | Description |
---|---|---|
$link |
mixed | |
$type |
mixed | |
$length |
mixed | |
$javascript |
mixed | |
$bitrate |
mixed | |
$captions |
mixed | |
$categories |
mixed | |
$channels |
mixed | |
$copyright |
mixed | |
$credits |
mixed | |
$description |
mixed | |
$duration |
mixed | |
$expression |
mixed | |
$framerate |
mixed | |
$hashes |
mixed | |
$height |
mixed | |
$keywords |
mixed | |
$lang |
mixed | |
$medium |
mixed | |
$player |
mixed | |
$ratings |
mixed | |
$restrictions |
mixed | |
$samplingrate |
mixed | |
$thumbnails |
mixed | |
$title |
mixed | |
$width |
mixed |
__toString
String-ified version
get_bitrate
Get the bitrate
get_caption
Get a single caption
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
get_captions
Get all captions
Return Value:
Array of {@see \SimplePie\Caption} objects
get_category
Get a single category
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
get_categories
Get all categories
Return Value:
Array of {@see \SimplePie\Category} objects
get_channels
Get the number of audio channels
get_copyright
Get the copyright information
get_credit
Get a single credit
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
get_credits
Get all credits
Return Value:
Array of {@see \SimplePie\Credit} objects
get_description
Get the description of the enclosure
get_duration
Get the duration of the enclosure
Parameters:
Parameter | Type | Description |
---|---|---|
$convert |
bool | Convert seconds into hh:mm:ss |
Return Value:
'hh:mm:ss' string if $convert
was specified, otherwise integer (or null if none found)
get_expression
Get the expression
Return Value:
Probably one of 'sample', 'full', 'nonstop', 'clip'. Defaults to 'full'
get_extension
Get the file extension
get_framerate
Get the framerate (in frames-per-second)
get_handler
Get the preferred handler
Return Value:
One of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3'
get_hash
Get a single hash
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
Return Value:
Hash as per media:hash
, prefixed with "$algo:"
See Also:
- http://www.rssboard.org/media-rss#media-hash -
get_hashes
Get all credits
Return Value:
Array of strings, see {@see \SimplePie\get_hash()}
get_height
Get the height
get_language
Get the language
Return Value:
Language code as per RFC 3066
See Also:
- http://tools.ietf.org/html/rfc3066 -
get_keyword
Get a single keyword
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
get_keywords
Get all keywords
Return Value:
Array of strings
get_length
Get length
Return Value:
Length in bytes
get_link
Get the URL
get_medium
Get the medium
Return Value:
Should be one of 'image', 'audio', 'video', 'document', 'executable'
See Also:
- http://www.rssboard.org/media-rss#media-content -
get_player
Get the player URL
Typically the same as {@see \SimplePie\get_permalink()}
Return Value:
Player URL
get_rating
Get a single rating
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
get_ratings
Get all ratings
Return Value:
Array of {@see \SimplePie\Rating} objects
get_restriction
Get a single restriction
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
get_restrictions
Get all restrictions
Return Value:
Array of {@see \SimplePie\Restriction} objects
get_sampling_rate
Get the sampling rate (in kHz)
get_size
Get the file size (in MiB)
Return Value:
File size in mebibytes (1048 bytes)
get_thumbnail
Get a single thumbnail
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
int |
Return Value:
Thumbnail URL
get_thumbnails
Get all thumbnails
Return Value:
Array of thumbnail URLs
get_title
Get the title
get_type
Get mimetype of the enclosure
Return Value:
MIME type
See Also:
- \SimplePie\get_real_type() -
get_width
Get the width
native_embed
Embed the enclosure using <embed>
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
Parameters:
Parameter | Type | Description |
---|---|---|
$options |
array|string | See first parameter to {@see \SimplePie\embed} |
Return Value:
HTML string to output
embed
Embed the enclosure using Javascript
$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 as360
) orauto
. Defaults toauto
, and it is recommended that you use this default.loop
(boolean): Do you want the media to loop when it's done? Defaults tofalse
.mediaplayer
(string): The location of the includedmediaplayer.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 as480
) orauto
. Defaults toauto
, 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 tofalse
, 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.
Parameters:
Parameter | Type | Description |
---|---|---|
$options |
array|string | Comma-separated key:value list, or array |
$native |
bool | Use <embed> |
Return Value:
HTML string to output
get_real_type
Get the real media type
Often, feeds lie to us, necessitating a bit of deeper inspection. This converts types to their canonical representations based on the file extension
Parameters:
Parameter | Type | Description |
---|---|---|
$find_handler |
bool | Internal use only, use {@see \SimplePie\get_handler()} instead |
Return Value:
MIME type
See Also:
- \SimplePie\get_type() -
Automatically generated on 2025-03-18