// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
// SPDX-License-Identifier: BSD-3-Clause
* Handles `<media:text>` captions as defined in Media RSS.
* Used by {@see \SimplePie\Enclosure::get_caption()} and {@see \SimplePie\Enclosure::get_captions()}
* This class can be overloaded with {@see \SimplePie\SimplePie::set_caption_class()}
* Constructor, used to input the data
* For documentation on all the parameters, see the corresponding
* properties and their accessors
public function __construct(
?string $startTime = null,
$this->startTime = $startTime;
$this->endTime = $endTime;
public function __toString()
// There is no $this->data here
return md5(serialize($this));
* @return string|null Time in the format 'hh:mm:ss.SSS'
public function get_endtime()
if ($this->endTime !== null) {
* @link http://tools.ietf.org/html/rfc3066
* @return string|null Language code as per RFC 3066
public function get_language()
if ($this->lang !== null) {
* @return string|null Time in the format 'hh:mm:ss.SSS'
public function get_starttime()
if ($this->startTime !== null) {
* Get the text of the caption
public function get_text()
if ($this->text !== null) {
* Get the content type (not MIME type)
* @return string|null Either 'text' or 'html'
public function get_type()
if ($this->type !== null) {
class_alias('SimplePie\Caption', 'SimplePie_Caption');