PluginProbe
Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch / trunk
Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch vtrunk
2.1.1 2.1.0 trunk 1.0 1.1 1.2 1.4.2 1.5.2 1.5.5 1.6.1 1.6.2 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
yt-player / youtube-player.php

youtube-player.php in Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch trunk, at youtube-player.php

40 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly.
4 }
5
6 if (!class_exists('YTPPlugin')) {
7 class YTPPlugin
8 {
9 function __construct()
10 {
11 add_action('enqueue_block_assets', [$this, 'enqueueBlockAssets']);
12 add_action('init', [$this, 'onInit']);
13 }
14
15 function enqueueBlockAssets()
16 {
17 wp_register_script('plyrIoJS', YTP_PLUGIN_DIR . 'public/js/plyr.js', [], YTP_PLUGIN_VERSION, true);
18 wp_register_style('plyrIoCSS', YTP_PLUGIN_DIR . 'public/css/plyr.css', [], YTP_PLUGIN_VERSION);
19 }
20
21 function onInit()
22 {
23 // register_block_type(__DIR__ . '/build/blocks/youtube-player');
24 register_block_type(__DIR__ . '/build/blocks/video');
25 register_block_type(__DIR__ . '/build/blocks/parent');
26
27 $localized_data = [
28 'ajaxURL' => admin_url('admin-ajax.php'),
29 'nonce' => wp_create_nonce('wp_ajax'),
30 'is_premium' => false,
31 'brandColor' => \YTP\Helper\Utils::getOptionDeep('ytp_option', 'brandColor', '#00AFFA'),
32 ];
33
34 wp_localize_script('yt-player-video-editor-script', 'ytpPlayer', $localized_data);
35 wp_localize_script('yt-player-parent-editor-script', 'ytpPlayer', $localized_data);
36 }
37 }
38 new YTPPlugin();
39 }
40