Download the PHP package schnti/video without Composer

On this page you can find all versions of the php package schnti/video. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package video

Video Plugin

A plugin for Kirby CMS to embed content from YouTube and Vimeo without compromising privacy.

Requires Kirby 3.6 or newer and PHP 7.4 or newer. Tested against Kirby 5.5 and 6.0-alpha.

Commercial Usage

This plugin is free but if you use it in a commercial project please consider

Installation

Download

Download the files and place them inside site/plugins/video.

Composer

Git Submodule

You can add the plugin as a Git submodule.

$ cd your/project/root
$ git submodule add https://github.com/schnti/kirby-video.git site/plugins/video
$ git submodule update --init --recursive
$ git commit -am "Add Kirby video plugin"

Run these commands to update the plugin:

$ cd your/project/root
$ git submodule foreach git checkout master
$ git submodule foreach git pull
$ git commit -am "Update submodules"
$ git submodule update --init --recursive

CSS (SCSS)

or

JS

or

Development

The stylesheet in dist/ is built from src/youtube.scss with Dart Sass — no build pipeline beyond that:

How to use it

Use one of these kirbytags:

Vimeo links that carry a privacy hash for unlisted videos work as well:

Both tags accept class and width.

How the privacy part works

Nothing is loaded from YouTube or Vimeo until the visitor clicks the button:

For Vimeo the thumbnail is looked up via the public oEmbed endpoint. That lookup only happens when the poster is not on disk yet, so a normal page view never talks to Vimeo.

If the lookup fails — for instance because the video was deleted — the embed still renders, just without a poster and with a 16:9 box. The failure is remembered for a day in the plugin cache, so a dead video does not cost a network timeout on every page view. Clearing the Kirby cache retries earlier.

At most one poster is fetched per request. A page with five new videos would otherwise do ten HTTP requests in a row while the visitor waits; it fills the gap over the next few page views instead.

Reusing the consent notice

video-consent knows nothing about YouTube or Vimeo and can be used for any embed that must not load before consent.

On consent the script hides the poster, reveals .embed-container and moves the iframe URL from data-src to src.

Pass text, button, headline and linkText for anything that is not a video; the defaults talk about videos. buttonClass adds classes to the button so you can reuse your own button style instead of restyling .video-hint-button, and icon shows an image above the headline.

Embeds that are not an iframe — a map that loads a provider script, for instance — need their own click handler. Reuse the notice for the markup and do the loading yourself; the plugin deliberately stays out of that.

Texts

The texts take the provider name as {{ service }}:

Key Default (en)
schnti.video.headline We respect your privacy!
schnti.video.text Click the button to activate the video. Then a connection to {{ service }} is established.
schnti.video.buttonText Activate video
schnti.video.linkText or watch on {{ service }}
schnti.video.id Video ID:

Texts without a placeholder pass through unchanged, and the old %s placeholder from 1.x is still filled in — overrides written back then keep working.

Options

Leave cache on — it is what keeps a deleted video from costing a network timeout on every page view.

Upgrading from 1.x

Backwards compatible. The markup now carries both the new generic class names (video-container, video-hint, video-hint-button, …) and the previous youtube-* ones, and stylesheet and script match either. The filenames of the built assets are unchanged.


All versions of video with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
getkirby/composer-installer Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package schnti/video contains the following files

Loading the files please wait ...