PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 4.6.3
WpStream – Live Streaming, Video on Demand, Pay Per View v4.6.3
4.14.0 4.13.2 4.13.1 4.13 4.12.5 4.12.4 4.12.3 4.12.2 4.12.1 4.12 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5 4.5.1 4.5.11 4.5.11.1 4.5.11.2 4.5.11.4 4.5.11.5 4.5.11.6 4.5.12 All 180 releases
wpstream / wpstream-elementor-base.php

wpstream-elementor-base.php in WpStream – Live Streaming, Video on Demand, Pay Per View 4.6.3, at wpstream-elementor-base.php

126 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ElementorWpStream;
3
4 /**
5 * Class Plugin
6 *
7 * Main Plugin class
8 * @since 1.2.0
9 */
10 class Plugin_Base {
11
12 /**
13 * Instance
14 *
15 * @since 1.2.0
16 * @access private
17 * @static
18 *
19 * @var Plugin The single instance of the class.
20 */
21 private static $_instance = null;
22
23 /**
24 * Instance
25 *
26 * Ensures only one instance of the class is loaded or can be loaded.
27 *
28 * @since 1.2.0
29 * @access public
30 *
31 * @return Plugin An instance of the class.
32 */
33 public static function instance() {
34 if ( is_null( self::$_instance ) ) {
35 self::$_instance = new self();
36 }
37 return self::$_instance;
38 }
39
40 /**
41 * widget_scripts
42 *
43 * Load required plugin core files.
44 *
45 * @since 1.2.0
46 * @access public
47 */
48 public function widget_scripts() {
49
50 }
51
52 /**
53 * Include Widgets files
54 *
55 * Load widgets files
56 *
57 * @since 1.2.0
58 * @access private
59 */
60 private function include_widgets_files() {
61 require_once( __DIR__ . '/widgets/player.php' );
62 require_once( __DIR__ . '/widgets/wpstream_chat.php' );
63 require_once( __DIR__ . '/widgets/player-lowlatency.php' );
64 require_once( __DIR__ . '/widgets/start_streaming.php' );
65 require_once( __DIR__ . '/widgets/media_list_channels.php' );
66 require_once( __DIR__ . '/widgets/media_list_vod.php' );
67 }
68
69 /**
70 * Register Widgets
71 *
72 * Register new Elementor widgets.
73 *
74 * @since 1.2.0
75 * @access public
76 */
77 public function register_widgets() {
78 // Its is now safe to include Widgets files
79 $this->include_widgets_files();
80
81 // Register Widgets
82
83 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Wpstream_Player_Base() );
84 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Wpstream_Chat_Base() );
85 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Wpstream_Player_LowLatecy_Base() );
86 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Wpstream_Start_Streaming_Base() );
87 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Wpstream_Media_List_Channel() );
88 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Wpstream_Media_List_Vod() );
89
90 }
91
92
93
94 /**
95 * Plugin class constructor
96 *
97 * Register plugin action hooks and filters
98 *
99 * @since 1.2.0
100 * @access public
101 */
102 public function add_elementor_widget_categories($elements_manager){
103 $elements_manager->add_category(
104 'wpstream',
105 [
106 'title' => __( 'WpStream Widgets', 'wpstream' ),
107 'icon' => 'fa fa-home',
108 ]
109 );
110
111
112 }
113 public function __construct() {
114
115 // Register widget scripts
116 add_action( 'elementor/frontend/after_register_scripts', [ $this, 'widget_scripts' ] );
117
118 // Register widgets
119 add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] );
120
121 add_action( 'elementor/elements/categories_registered', [ $this, 'add_elementor_widget_categories' ] );
122 }
123 }
124
125 // Instantiate Plugin Class
126 Plugin_Base::instance();