automattic/jetpack-videopress

VideoPress package

Installs: 8 787

Dependents: 3

Suggesters: 0

Security: 0

Stars: 3

Watchers: 8

Forks: 1

Type:jetpack-library

v0.24.11 2024-10-07 19:02 UTC

README

VideoPress package

How to consume VideoPress package

Install the right packages

First, let's make sure that the automattic/jetpack-videopress package is set up in your composer.json file:

At minimum you need three things. One is the automattic/jetpack-autoloader package, which will ensure that you're not colliding with any other plugins on the site that may be including the same packages. Two, of course, is the automattic/jetpack-videopress package. Third is our automattic/jetpack-config package that will be your tool for initializing the packages.

Initialize the package

Second, we must initialize ("configure") the jetpack-videopress package within your plugin, and provide the information about it.

This is where the jetpack-config and jetpack-autoload packages come into play. Do this, and you're ready to start consuming the Jetpack connection!

use Automattic\Jetpack\Config;

require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload_packages.php';

function jpcs_load_plugin() {

	// Here we enable the Jetpack packages.
	$config = new Config();
	$config->ensure( 'videopress' );
}

add_action( 'plugins_loaded', 'jpcs_load_plugin', 1 );

Initialization Options

When initializing VideoPress, you can choose whether you want to initialize the Admin UI or not. By default, the admin UI is not initialized. If you want it, just add the admin_ui key in your options when ensuring the feature:

$config = new Config();
$config->ensure(
	'videopress',
	array( 'admin_ui' => true )
);

Development

Build all bundles

jetpack build packages/videopress

Build in watching dog mode 🐕

jetpack watch packages/videopress

Get Help

Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

videopress is licensed under GNU General Public License v2 (or later)