🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-14 13:42:35 | PHP 8.1.34
📂
/ (Root)
/
home
/
therahul
/
ramailobhela.com
/
wp-content
/
themes
/
nighty
/
elementor
/
widgets
📍 /home/therahul/ramailobhela.com/wp-content/themes/nighty/elementor/widgets
🔄 Refresh
✏️
Editing: video.php
Writable
<?php use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Utils; use Elementor\Group_Control_Border; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class Nighty_Elementor_Video extends Widget_Base { public function get_name() { return 'nighty_elementor_video'; } public function get_title() { return esc_html__( 'Ova Video', 'nighty' ); } public function get_icon() { return 'eicon-video-playlist'; } public function get_categories() { return [ 'nighty' ]; } public function get_script_depends() { return [ 'nighty-elementor-video' ]; } // Add Your Controll In This Function protected function register_controls() { $this->start_controls_section( 'section_video', [ 'label' => esc_html__( 'Video', 'nighty' ), ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-play', 'library' => 'all', ], ] ); $this->add_control( 'icon_url_video', [ 'label' => esc_html__( 'URL Video', 'nighty' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Enter your URL', 'nighty' ) . ' (YouTube)', 'default' => 'https://www.youtube.com/watch?v=XHOmBV4js_E', ] ); $this->add_control( 'alignment', [ 'label' => esc_html__( 'Alignment', 'nighty' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'nighty' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'nighty' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'nighty' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => 'center', 'toggle' => true, 'selectors' => [ '{{WRAPPER}} .ova-video' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'icon_animation', [ 'label' => esc_html__( 'Animation', 'nighty' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'On', 'nighty' ), 'label_off' => esc_html__( 'Off', 'nighty' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'video_options', [ 'label' => esc_html__( 'Video Options', 'nighty' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'icon_url_video!' => '', ], ] ); $this->add_control( 'autoplay_video', [ 'label' => esc_html__( 'Autoplay', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'nighty' ), 'label_off' => esc_html__( 'No', 'nighty' ), 'default' => 'yes', 'condition' => [ 'icon_url_video!' => '', ], ] ); $this->add_control( 'mute_video', [ 'label' => esc_html__( 'Mute', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'nighty' ), 'label_off' => esc_html__( 'No', 'nighty' ), 'default' => 'no', 'condition' => [ 'icon_url_video!' => '', ], ] ); $this->add_control( 'loop_video', [ 'label' => esc_html__( 'Loop', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'nighty' ), 'label_off' => esc_html__( 'No', 'nighty' ), 'default' => 'yes', 'condition' => [ 'icon_url_video!' => '', ], ] ); $this->add_control( 'player_controls_video', [ 'label' => esc_html__( 'Player Controls', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'nighty' ), 'label_off' => esc_html__( 'No', 'nighty' ), 'default' => 'yes', 'condition' => [ 'icon_url_video!' => '', ], ] ); $this->add_control( 'modest_branding_video', [ 'label' => esc_html__( 'Modest Branding', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'nighty' ), 'label_off' => esc_html__( 'No', 'nighty' ), 'default' => 'yes', 'condition' => [ 'icon_url_video!' => '', ], ] ); $this->add_control( 'show_info_video', [ 'label' => esc_html__( 'Show Info', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'nighty' ), 'label_off' => esc_html__( 'No', 'nighty' ), 'default' => 'no', 'condition' => [ 'icon_url_video!' => '', ], ] ); $this->end_controls_section(); /* Begin section BUTTON style */ $this->start_controls_section( 'section_icon_style', [ 'label' => esc_html__( 'Button', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_font_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, ], ], 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_bgsize', [ 'label' => esc_html__( 'Background Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 400, ], ], 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_border_radius', [ 'label' => esc_html__( 'Border Radius', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .ova-video .icon-content-view .content:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'icon_before_border', 'selector' => '{{WRAPPER}} .ova-video .icon-content-view .content:before', ] ); $this->add_responsive_control( 'margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem'], 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'tabs_icon_style' ); $this->start_controls_tab( 'tab_icon_normal', [ 'label' => esc_html__( 'Normal', 'nighty' ), ] ); $this->add_control( 'icon_color_normal', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content i' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'icon_primary_background_normal', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content:before' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_icon_hover', [ 'label' => esc_html__( 'Hover', 'nighty' ), ] ); $this->add_control( 'icon_color_hover', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content:hover i' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'icon_primary_background_hover', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .content:hover:before' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); /* Begin section BUTTON style */ $this->start_controls_section( 'section_circle_background_style', [ 'label' => esc_html__( 'Circle Background', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'circle_background_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, ], ], 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .video-btn:after' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'circle_background_color', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .video-btn:after' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'circle_background_border_radius', [ 'label' => esc_html__( 'Border Radius', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-video .icon-content-view .video-btn:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } // Render Template Here protected function render() { $settings = $this->get_settings(); $icon = $settings['icon']; $url_video = $settings['icon_url_video']; $icon_animation = $settings['icon_animation']; // video options $autoplay = $settings['autoplay_video']; $mute = $settings['mute_video']; $loop = $settings['loop_video']; $controls = $settings['player_controls_video']; $modest = $settings['modest_branding_video']; $show_info = $settings['show_info_video']; ?> <div class="ova-video"> <div class="icon-content-view video_active <?php if( $icon_animation != 'yes') { echo esc_attr('no-animation'); } ?>"> <?php if ( ! empty( $url_video ) ) : ?> <div class="content video-btn" data-src="<?php echo esc_url( $url_video ); ?>" data-autoplay="<?php echo esc_attr( $autoplay ); ?>" data-mute="<?php echo esc_attr( $mute ); ?>" data-loop="<?php echo esc_attr( $loop ); ?>" data-controls="<?php echo esc_attr( $controls ); ?>" data-modest="<?php echo esc_attr( $modest ); ?>" data-show_info="<?php echo esc_attr( $show_info ); ?> "> <?php \Elementor\Icons_Manager::render_icon( $icon, [ 'aria-hidden' => 'true' ] ); ?> </div> <?php endif; ?> </div> <div class="ova-modal-container"> <div class="modal"> <i class="modal-close ovaicon-cancel"></i> <iframe class="modal-video" allow="autoplay"></iframe> </div> </div> </div> <?php } } $widgets_manager->register( new Nighty_Elementor_Video() );
💾 Save Changes
❌ Cancel