PluginProbe
HTML5 Audio Player – The Ultimate No-Code Podcast, MP3 & Audio Player / trunk
HTML5 Audio Player – The Ultimate No-Code Podcast, MP3 & Audio Player vtrunk
2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 2.8.0 2.7.5 2.7.4 2.7.3 2.7.2 2.7.1 2.7.0 2.6.4 2.6.3 2.6.2 2.6.1 trunk 1.0 1.1 1.2 1.4 1.4.1 2.1.12 2.1.6 2.2.14 All 42 releases
html5-audio-player / blocks.php

blocks.php in HTML5 Audio Player – The Ultimate No-Code Podcast, MP3 & Audio Player trunk, at blocks.php

46 lines 1.6 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 return;
4 }
5
6 use H5APPlayer\Helper\Functions;
7
8 if (!class_exists('H5AP_Block')) {
9 class H5AP_Block
10 {
11 function __construct()
12 {
13 add_action('init', [$this, 'init']);
14 add_action('enqueue_block_assets', [$this, 'enqueue_block_assets']);
15 add_action('enqueue_block_editor_assets', [$this, 'enqueue_block_editor_assets']);
16 }
17
18 function enqueue_block_editor_assets()
19 {
20 wp_localize_script('h5ap-audioplayer-editor-script', 'h5apPlayer', [
21 'speed' => explode(',', Functions::getSetting('speed', '0.5, 1, 1.5, 2.0, 2.5')),
22 'multipleAudio' => (bool) Functions::getSetting('multipleAudio', false),
23 'plyrio_js' => H5AP_PLUGIN_DIR . 'assets/js/plyr-v3.7.2.js',
24 'plyr_js' => H5AP_PLUGIN_DIR . 'build/player.js',
25 'isPipe' => false,
26 'ajaxUrl' => admin_url('admin-ajax.php')
27 ]);
28 }
29
30 function enqueue_block_assets()
31 {
32 // plyrio library
33 wp_register_script('bplugins-plyrio', H5AP_PLUGIN_DIR . 'assets/js/plyr-v3.7.2.js', array(), '3.7.2', false);
34 wp_register_style('bplugins-plyrio', H5AP_PLUGIN_DIR . 'assets/css/plyr-v3.7.2.css', array(), '3.7.2', 'all');
35 }
36
37 function init() {
38 register_block_type(__DIR__ . '/build/blocks/audioplayer');
39 register_block_type(__DIR__ . '/build/blocks/audioplaylist');
40 register_block_type(__DIR__ . '/build/blocks/radio-player');
41 }
42 }
43
44 new H5AP_Block();
45 }
46