VideoPress package
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.
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 );
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 )
);
Build all bundles
jetpack build packages/videopress
Build in watching dog mode 🐕
jetpack watch packages/videopress
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.
Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.
videopress is licensed under GNU General Public License v2 (or later)