PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 4.8
WpStream – Live Streaming, Video on Demand, Pay Per View v4.8
4.14.1 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 All 181 releases
wpstream / widgets / player-lowlatency.php

player-lowlatency.php in WpStream – Live Streaming, Video on Demand, Pay Per View 4.8, at widgets/player-lowlatency.php

181 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ElementorWpStream\Widgets;
3
4 use Elementor\Widget_Base;
5 use Elementor\Controls_Manager;
6
7 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
9
10 class Wpstream_Player_LowLatecy_Base extends Widget_Base {
11
12 /**
13 * Retrieve the widget name.
14 *
15 * @since 1.0.0
16 *
17 * @access public
18 *
19 * @return string Widget name.
20 */
21 public function get_name() {
22 return 'Wpstream_Player_LowLatecy';
23 }
24
25 public function get_categories() {
26 return [ 'wpstream' ];
27 }
28
29
30 /**
31 * Retrieve the widget title.
32 *
33 * @since 1.0.0
34 *
35 * @access public
36 *
37 * @return string Widget title.
38 */
39 public function get_title() {
40 return '<div class="wpestate_elementor_widget_title">'.__( 'WpStream Player - Private Beta / Requires Approval', 'wpstream' ).'</div>';
41 }
42
43 /**
44 * Retrieve the widget icon.
45 *
46 * @since 1.0.0
47 *
48 * @access public
49 *
50 * @return string Widget icon.
51 */
52 public function get_icon() {
53 return 'eicon-play-o';
54 }
55
56
57
58 /**
59 * Retrieve the list of scripts the widget depended on.
60 *
61 * Used to set scripts dependencies required to run the widget.
62 *
63 * @since 1.0.0
64 *
65 * @access public
66 *
67 * @return array Widget scripts dependencies.
68 */
69 public function get_script_depends() {
70 return [ '' ];
71 }
72
73 /**
74 * Register the widget controls.
75 *
76 * Adds different input fields to allow the user to change and customize the widget settings.
77 *
78 * @since 1.0.0
79 *
80 * @access protected
81 */
82
83 public function elementor_transform($input){
84 $output=array();
85 if( is_array($input) ){
86 foreach ($input as $key=>$tax){
87 $output[$tax['value']]=$tax['label'];
88 }
89 }
90 return $output;
91 }
92
93 protected function _register_controls() {
94 global $all_tax;
95
96
97
98 $this->start_controls_section(
99 'section_content',
100 [
101 'label' => __( 'Content', 'wpstream' ),
102 ]
103 );
104
105 $this->add_control(
106 'item_id',
107 [
108 'label' => __( 'Product/Free Product id', 'wpstream' ),
109 'label_block'=>true,
110 'type' => Controls_Manager::TEXT,
111 ]
112 );
113
114 $this->add_control(
115 'user_id',
116 [
117 'label' => __( 'User Id', 'wpstream' ),
118 'label_block'=>true,
119 'type' => Controls_Manager::TEXT,
120 'description' => esc_html__( "We will use the first channel of this user id(product id will be ignored.).","wpestate")
121 ]
122 );
123
124 $this->end_controls_section();
125
126
127 }
128
129 /**
130 * Render the widget output on the frontend.
131 *
132 * Written in PHP and used to generate the final HTML.
133 *
134 * @since 1.0.0
135 *
136 * @access protected
137 */
138
139 public function wpresidence_send_to_shortcode($input){
140 $output='';
141 if($input!==''){
142 $numItems = count($input);
143 $i = 0;
144
145 foreach ($input as $key=>$value){
146 $output.=$value;
147 if(++$i !== $numItems) {
148 $output.=', ';
149 }
150 }
151 }
152 return $output;
153 }
154
155 protected function render() {
156 $settings = $this->get_settings_for_display();
157
158 $attributes['id'] = $settings['item_id'] ;
159 $attributes['user_id'] = $settings['user_id'] ;
160 global $wpstream_plugin;
161 echo $wpstream_plugin->wpstream_insert_player__low_latency_elementor($attributes);
162 }
163
164 /**
165 * Render the widget output in the editor.
166 *
167 * Written as a Backbone JavaScript template and used to generate the live preview.
168 *
169 * @since 1.0.0
170 *
171 * @access protected
172 */
173 protected function content_template() {
174 ?>
175 <div class="title">
176 {{{ settings.title }}}
177 </div>
178 <?php
179 }
180 }
181