Elementor_Enhancer.php
3 years ago
EmbedPress_Core_Installer.php
6 years ago
EmbedPress_Notice.php
4 years ago
EmbedPress_Plugin_Usage_Tracker.php
2 years ago
Extend_CustomPlayer_Controls.php
3 years ago
Extend_Elementor_Controls.php
3 years ago
Feature_Enhancer.php
2 years ago
Helper.php
2 years ago
Extend_CustomPlayer_Controls.php
99 lines
| 1 | <?php |
| 2 | |
| 3 | namespace EmbedPress\Includes\Classes; |
| 4 | |
| 5 | use \Elementor\Controls_Manager; |
| 6 | |
| 7 | class Extend_CustomPlayer_Controls |
| 8 | { |
| 9 | |
| 10 | public function __construct() |
| 11 | { |
| 12 | add_action('extend_customplayer_controls', [$this, 'extend_elementor_customplayer_controls'], 10, 4); |
| 13 | } |
| 14 | |
| 15 | public function extend_elementor_customplayer_controls($that, $infix = '', $pro_text = '', $pro_class = '') |
| 16 | { |
| 17 | |
| 18 | $condition = [ |
| 19 | 'emberpress_custom_player' => 'yes', |
| 20 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video', 'selfhosted_audio'] |
| 21 | ]; |
| 22 | |
| 23 | $that->add_control( |
| 24 | 'embepress_player_restart', |
| 25 | [ |
| 26 | 'label' => __('Restart', 'embedpress'), |
| 27 | 'type' => Controls_Manager::SWITCHER, |
| 28 | 'label_block' => false, |
| 29 | 'return_value' => 'yes', |
| 30 | 'default' => 'yes', |
| 31 | 'condition' => $condition, |
| 32 | ] |
| 33 | ); |
| 34 | $that->add_control( |
| 35 | 'embepress_player_rewind', |
| 36 | [ |
| 37 | 'label' => __('Rewind', 'embedpress'), |
| 38 | 'type' => Controls_Manager::SWITCHER, |
| 39 | 'label_block' => false, |
| 40 | 'return_value' => 'yes', |
| 41 | 'default' => 'yes', |
| 42 | 'condition' => $condition, |
| 43 | ] |
| 44 | ); |
| 45 | $that->add_control( |
| 46 | 'embepress_player_fast_forward', |
| 47 | [ |
| 48 | 'label' => __('Fast Forward', 'embedpress'), |
| 49 | 'type' => Controls_Manager::SWITCHER, |
| 50 | 'label_block' => false, |
| 51 | 'return_value' => 'yes', |
| 52 | 'default' => 'yes', |
| 53 | 'condition' => $condition, |
| 54 | ] |
| 55 | ); |
| 56 | $that->add_control( |
| 57 | 'embepress_player_tooltip', |
| 58 | [ |
| 59 | 'label' => sprintf(__('Tooltip %s', 'embedpress'), $pro_text), |
| 60 | 'type' => Controls_Manager::SWITCHER, |
| 61 | 'label_block' => false, |
| 62 | 'return_value' => 'yes', |
| 63 | 'default' => 'yes', |
| 64 | 'condition' => $condition, |
| 65 | 'classes' => $pro_class, |
| 66 | |
| 67 | ] |
| 68 | ); |
| 69 | $that->add_control( |
| 70 | 'embepress_player_hide_controls', |
| 71 | [ |
| 72 | 'label' => sprintf(__('Auto Hide Controls %s', 'embedpress'), $pro_text), |
| 73 | 'type' => Controls_Manager::SWITCHER, |
| 74 | 'label_block' => false, |
| 75 | 'return_value' => 'yes', |
| 76 | 'default' => '', |
| 77 | 'classes' => $pro_class, |
| 78 | 'condition' => [ |
| 79 | 'emberpress_custom_player' => 'yes', |
| 80 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video'] |
| 81 | ], |
| 82 | ] |
| 83 | ); |
| 84 | $that->add_control( |
| 85 | 'embepress_player_download', |
| 86 | [ |
| 87 | 'label' => sprintf(__('Source Link %s', 'embedpress'), $pro_text), |
| 88 | 'type' => Controls_Manager::SWITCHER, |
| 89 | 'label_block' => false, |
| 90 | 'return_value' => 'yes', |
| 91 | 'default' => 'yes', |
| 92 | 'condition' => $condition, |
| 93 | 'classes' => $pro_class, |
| 94 | ] |
| 95 | ); |
| 96 | |
| 97 | } |
| 98 | } |
| 99 |