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
array
string
Comma-separated key:value list, or array
Returns
string
HTML 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_Caption
null
Get all captions
get_captions() : array | null
Returns
array
null
Array of {@see SimplePie_Caption} objects
Get all categories
get_categories() : array | null
Returns
array
null
Array of {@see SimplePie_Category} objects
Get a single category
get_category(integer $key = 0
) : \SimplePie_Category | null
Parameters
$key
integer
Returns
\SimplePie_Category
null
Get the number of audio channels
get_channels() : integer | null
Get the copyright information
get_copyright() : \SimplePie_Copyright | null
Returns
\SimplePie_Copyright
null
Get a single credit
get_credit(integer $key = 0
) : \SimplePie_Credit | null
Parameters
$key
integer
Returns
\SimplePie_Credit
null
Get all credits
get_credits() : array | null
Returns
array
null
Array 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
string
Convert seconds into hh:mm:ss
Returns
string
integer
null
'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found)
Get the expression
get_expression() : string
Returns
string
Probably 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
string
null
One of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3'
Get a single hash
get_hash(integer $key = 0
) : string | null
Parameters
$key
integer
Returns
string
null
Hash as per `media:hash`, prefixed with "$algo:"
Get all credits
get_hashes() : array | null
Returns
array
null
Array 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
string
null
Get all keywords
get_keywords() : array | null
Returns
array
null
Array of strings
Get the language
get_language() : string | null
Returns
string
null
Language code as per RFC 3066
Get length
get_length() : float
Returns
float
Length in bytes
Get the URL
get_link() : string | null
Get the medium
get_medium() : string | null
Returns
string
null
Should be one of 'image', 'audio', 'video', 'document', 'executable'
Get the player URL
get_player() : string | null
Returns
string
null
Player URL
Get a single rating
get_rating(integer $key = 0
) : \SimplePie_Rating | null
Parameters
$key
integer
Returns
\SimplePie_Rating
null
Get all ratings
get_ratings() : array | null
Returns
array
null
Array 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
boolean
Internal use only, use {@see get_handler()} instead
Returns
string
MIME type
Get a single restriction
get_restriction(integer $key = 0
) : \SimplePie_Restriction | null
Parameters
$key
integer
Returns
\SimplePie_Restriction
null
Get all restrictions
get_restrictions() : array | null
Returns
array
null
Array 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
float
null
File size in mebibytes (1048 bytes)
Get a single thumbnail
get_thumbnail(integer $key = 0
) : string | null
Parameters
$key
integer
Returns
string
null
Thumbnail URL
Get all thumbnails
get_thumbnails() : array | null
Returns
array
null
Array of thumbnail URLs
Get the title
get_title() : string | null
Get mimetype of the enclosure
get_type() : string | null
Returns
string
null
MIME 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
array
string
See first paramter to {@see embed}
Returns
string
HTML 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