VideoSourceTag
class VideoSourceTag extends BaseTag
Generates an HTML <source>
tag that can be used with a <video>
tag.
For example:
<video poster="https://res.cloudinary.com/demo/video/upload/dog.jpg">
<source src="https://res.cloudinary.com/demo/video/upload/vc_h265/dog.mp4" type="video/mp4; codecs=hev1">
<source src="https://res.cloudinary.com/demo/video/upload/vc_vp9/dog.webm" type="video/webm; codecs=vp9">
<source src="https://res.cloudinary.com/demo/video/upload/vc_auto/dog.mp4" type="video/mp4">
<source src="https://res.cloudinary.com/demo/video/upload/vc_auto/dog.webm" type="video/webm">
</video>
Properties
Configuration | $config | from BaseTag | |
Video | $video | ||
VideoTransformation | $additionalTransformation |
Methods
Image format of the video poster.
Use fetch format transformation ("f_") instead of file extension.
VideoSourceTag constructor.
Imports (merges) the configuration.
Adds a tag class.
Resets tag classes and sets the specified one.
Sets tag attribute.
Sets (multiple) tag attributes.
Deletes tag attribute.
Adds tag content.
Sets the content of the tag to the specified one.
Serializes the tag to string.
Serializes the tag content.
Serializes the tag attributes.
Serializes the tag to string.
Serializes the tag to string.
Sets the type.
Details
$this
videoPosterFormat(string $format)
Image format of the video poster.
$this
useFetchFormat(bool $useFetchFormat = true)
Use fetch format transformation ("f_") instead of file extension.
__construct(mixed $asset, Configuration|string|array|null $configuration = null, null $additionalTransformation = null)
VideoSourceTag constructor.
Configuration
configuration(Configuration|string|array|null $configuration)
Sets the configuration.
BaseTag
importConfiguration(Configuration|string|array|null $configuration)
Imports (merges) the configuration.
BaseTag
addClass(string|array $class)
Adds a tag class.
BaseTag
setClass(string|array $class)
Resets tag classes and sets the specified one.
BaseTag
setAttribute(string $key, mixed $value = null)
Sets tag attribute.
BaseTag
setAttributes(array $attributes)
Sets (multiple) tag attributes.
BaseTag
deleteAttribute(string $key)
Deletes tag attribute.
$this
addContent(mixed $content, mixed $key = null)
Adds tag content.
BaseTag
setContent(mixed $content)
Sets the content of the tag to the specified one.
string
serialize()
Serializes the tag to string.
string
serializeContent(array $additionalContent = [], bool $prependAdditionalContent = false)
Serializes the tag content.
string
serializeAttributes(array $attributes = [])
Serializes the tag attributes.
string
toTag()
Serializes the tag to string.
string
__toString()
Serializes the tag to string.
VideoSourceTag
video(mixed $video, Configuration $configuration = null)
Sets the video of the tag.
VideoSourceTag
type(SourceType|string $type, string|array $codecs = null)
Sets the type.
Constants
SINGLE_QUOTES |
|
DOUBLE_QUOTES |
|
NAME |
|
IS_VOID |
|