Download the PHP package justijndepover/embed-video without Composer
On this page you can find all versions of the php package justijndepover/embed-video. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justijndepover/embed-video
More information about justijndepover/embed-video
Files in justijndepover/embed-video
Package embed-video
Short Description Extract the embed url from Youtube and Vimeo videos
License MIT
Homepage https://github.com/justijndepover/embed-video
Informations about the package embed-video
Embed Video
This package makes it easier to work with both Youtube and Vimeo video url's. It automatically detects the reference from the url.
For example:
are all valid youtube links, but to embed an iFrame, you need the third option.
This package allows all the options as input, and is able to generate the correct output urls to embed the iframe.
Installation
You can install the package with composer
Usage
If you provide the class with a faulty link, a Justijndepover\EmbedVideo\VideoException
will be thrown.
Validate
This will validate the given url and return either true
or false
Embed
This will generate the embedded iframe for either Youtube or Vimeo.
Embed url
This will generate the embedded url used in the iframe for either Youtube or Vimeo.
Thumbnail
This will generate a thumbnail url for the cover image;
Reference
This will return the video reference;
Mute
To add mute to the embed iframe, you can make use of the fluent syntax:
Autoplay
To add autoplay to the embed iframe, you can make use of the fluent syntax:
note: adding autoplay will automatically mute the video.
Class
To add a class to the embed iframe, you can make use of the fluent syntax:
Additional attributes
To add additional attributes to the embed iframe, you can make use of the fluent syntax:
Security
If you find any security related issues, please open an issue or contact me directly at [email protected].
Contribution
If you wish to make any changes or improvements to the package, feel free to make a pull request.
License
The MIT License (MIT). Please see License File for more information.