Download the PHP package becklyn/video-platforms without Composer
On this page you can find all versions of the php package becklyn/video-platforms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download becklyn/video-platforms
More information about becklyn/video-platforms
Files in becklyn/video-platforms
Package video-platforms
Short Description Several helpers for integrating video tools in your Symfony application.
License BSD-3-Clause
Homepage https://github.com/Becklyn/video-platforms
Informations about the package video-platforms
Video Platforms Bundle
Several helpers for integrating video tools in your Symfony application.
Installation
Usage
Parsing an URL
Storage
Any video will be stored as normalized array, and can be recreated from it. See below "Usage in entities" for more information.
There is also a simple string-based serialization, although you will lose the initial format:
The internal format is <platform>@<id>
. That can easily be stored in the database.
To unserialize, just use
Usage in entities
Your entity should look something like this:
Usage in Forms
In your form you should use the VideoUrlType
:
Tip:
When entering the value in a form field, you can always use the string-serialized version, to avoid parsing clashes. So just enter
vimeo@123
for example.
Validation
You can use the @VideoUrl()
annotation on any property.
You can also define which platforms you want to allow. Use the platform key:
Registering a custom platform
Implement the VideoUrlParserInterface
and either use autoconfiguration
or add the DI tag becklyn.video-platforms.parser
.
Supported Formats
Vimeo
123456789
(plain id, watch out for clashes)https://vimeo.com/123456789
YouTube
_1234567890
(plain id, watch out for clashes)https://www.youtube.com/watch?v=_1234567890
https://www.youtube.com/v/_1234567890
https://youtu.be/_1234567890
https://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3D_1234567890&format=json
https://youtube.com/embed/_1234567890
https://www.youtube.com/attribution_link?a=sgsfg&u=%2Fwatch%3Fv%3D_1234567890%26feature%3Dem-uploademail
All versions of video-platforms with dependencies
becklyn/rad-bundles Version ^1.1.0
symfony/form Version ^v5.4.3 || ^v6.0.3
symfony/http-foundation Version ^v5.4.3 || ^v6.0.3
symfony/http-kernel Version ^v5.4.3 || ^v6.0.3
symfony/validator Version ^v5.4.3 || ^v6.0.3