start_controls_section( 'section_content', [ 'label' => __( 'Device', 'elementor-extras' ), ] ); $this->add_control( 'device_type', [ 'label' => __( 'Type', 'elementor-extras' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'phone', 'options' => [ 'phone' => [ 'title' => __( 'Phone', 'elementor-extras' ), 'icon' => 'fa fa-mobile-phone', ], 'tablet' => [ 'title' => __( 'Tablet', 'elementor-extras' ), 'icon' => 'fa fa-tablet', ], 'laptop' => [ 'title' => __( 'Laptop', 'elementor-extras' ), 'icon' => 'fa fa-laptop', ], 'desktop' => [ 'title' => __( 'Desktop', 'elementor-extras' ), 'icon' => 'fa fa-desktop', ], 'window' => [ 'title' => __( 'Window', 'elementor-extras' ), 'icon' => 'nicon nicon-window', ], ], 'frontend_available' => true, ] ); $this->add_control( 'device_media_type', [ 'label' => __( 'Media Type', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'image', 'options' => [ 'image' => __( 'Image', 'elementor-extras' ), 'video' => __( 'Video', 'elementor-extras' ), ], ] ); $this->add_control( 'device_orientation', [ 'label' => __( 'Orientation', 'elementor-extras' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'portrait', 'options' => [ 'portrait' => [ 'title' => __( 'Portrait', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-portrait', ], 'landscape' => [ 'title' => __( 'Landscape', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-landscape', ], ], 'prefix_class' => 'ee-device-orientation-', 'condition' => [ 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], ] ] ); $this->add_control( 'device_orientation_control', [ 'label' => __( 'Orientation Control', 'elementor-extras' ), 'description' => __( 'Show orientation control on frontend. ', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'device_align', [ 'label' => __( 'Alignment', 'elementor-extras' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'center', 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor-extras' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor-extras' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor-extras' ), 'icon' => 'eicon-h-align-right', ], ], 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}};', ], ] ); $this->add_responsive_control( 'device_width', [ 'label' => __( 'Maximum Width', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1920, 'step' => 10, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .ee-device-wrapper' => 'max-width: {{SIZE}}{{UNIT}}; width: 100%;', '{{WRAPPER}} .ee-device' => 'width: 100%;', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_screenshot', [ 'label' => __( 'Screen', 'elementor-extras' ), 'condition' => [ 'device_media_type' => [ 'image' ], ] ] ); $this->start_controls_tabs( 'tabs_media' ); $this->start_controls_tab( 'tab_media_portrait', [ 'label' => __( 'Default', 'elementor-extras' ), ] ); $this->add_control( 'media_portrait_screenshot', [ 'label' => __( 'Choose Screenshot', 'elementor-extras' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true ], 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'condition' => [ 'device_media_type' => [ 'image' ], ] ] ); $this->add_control( 'screen_phone_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'Use an image or video with the ratio of 16:9', 'elementor-extras' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', 'condition' => [ 'device_type' => [ 'phone', 'desktop' ], ], ] ); $this->add_control( 'screen_tablet_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'Use an image or video with the ratio of 4:3', 'elementor-extras' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', 'condition' => [ 'device_type' => 'tablet' ], ] ); $this->add_control( 'screen_laptop_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'Use an image or video with the ratio of 16:10', 'elementor-extras' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', 'condition' => [ 'device_type' => 'laptop' ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'media_portrait_screenshot', 'label' => __( 'Screenshot Size', 'elementor-extras' ), 'default' => 'large', 'condition' => [ 'media_portrait_screenshot[url]!' => '', 'device_media_type' => [ 'image' ], ] ] ); $this->add_control( 'media_portrait_screenshot_scrollable', [ 'label' => __( 'Scrollable', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'scrollable', 'prefix_class' => 'ee-device-portrait-', 'condition' => [ 'media_portrait_screenshot[url]!' => '', 'device_media_type' => [ 'image' ], 'device_type!' => [ 'window' ], ] ] ); $this->add_responsive_control( 'media_portrait_screenshot_align', [ 'label' => __( 'Vertical Align', 'elementor-extras' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'flex-start', 'options' => [ 'flex-start' => [ 'title' => __( 'Top', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-top', ], 'center' => [ 'title' => __( 'Middle', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-center', ], 'flex-end' => [ 'title' => __( 'Bottom', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-bottom', ], 'initial' => [ 'title' => __( 'Custom', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-custom', ], ], 'selectors' => [ '{{WRAPPER}} .ee-device__media__screen--image' => 'align-items: {{VALUE}};', '{{WRAPPER}} .ee-device__media__screen--image .ee-device__media__screen__inner' => 'top: auto;', ], 'condition' => [ 'media_portrait_screenshot_scrollable!' => 'scrollable', 'media_portrait_screenshot[url]!' => '', 'device_media_type' => [ 'image' ], 'device_type!' => [ 'window' ], ] ] ); $this->add_control( 'media_portrait_screenshot_position', [ 'label' => __( 'Offset Top (%)', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ee-device__media__screen--image .ee-device__media__screen__inner figure' => 'transform: translateY(-{{SIZE}}%);', ], 'condition' => [ 'media_portrait_screenshot_scrollable!' => 'scrollable', 'media_portrait_screenshot_align' => 'initial', 'media_portrait_screenshot[url]!' => '', 'device_media_type' => [ 'image' ], 'device_type!' => [ 'window' ], ] ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_media_landscape', [ 'label' => __( 'Landscape', 'elementor-extras' ), 'condition' => [ 'device_orientation_control' => 'yes', 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], ] ] ); $this->add_control( 'media_landscape_screenshot', [ 'label' => __( 'Choose Screenshot', 'elementor-extras' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true ], 'condition' => [ 'device_orientation_control' => 'yes', 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'media_landscape_screenshot', // Actually its `image_size` 'label' => __( 'Screenshot Size', 'elementor-extras' ), 'default' => 'large', 'condition' => [ 'device_orientation_control' => 'yes', 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], 'media_landscape_screenshot[url]!' => '', ] ] ); $this->add_control( 'media_landscape_screenshot_scrollable', [ 'label' => __( 'Scrollable', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'scrollable', 'prefix_class' => 'ee-device-landscape-', 'condition' => [ 'device_orientation_control' => 'yes', 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], 'media_landscape_screenshot[url]!' => '' ] ] ); $this->add_responsive_control( 'media_landscape_screenshot_align', [ 'label' => __( 'Vertical Align', 'elementor-extras' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'flex-start', 'options' => [ 'flex-start' => [ 'title' => __( 'Top', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-top', ], 'center' => [ 'title' => __( 'Middle', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-center', ], 'flex-end' => [ 'title' => __( 'Bottom', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-bottom', ], 'initial' => [ 'title' => __( 'Custom', 'elementor-extras' ), 'icon' => 'nicon nicon-mobile-screen-custom', ], ], 'selectors' => [ '{{WRAPPER}} .ee-device__media__screen.ee-device__media__screen__landscape' => 'align-items: {{VALUE}};', '{{WRAPPER}} .ee-device__media__screen__landscape .ee-device__media__screen__inner' => 'top: auto;', ], 'condition' => [ 'media_landscape_screenshot_scrollable!' => 'scrollable', 'device_orientation_control' => 'yes', 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], 'media_landscape_screenshot[url]!' => '', ] ] ); $this->add_control( 'media_landscape_screenshot_position', [ 'label' => __( 'Offset Top (%)', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ee-device__media__screen__landscape .ee-device__media__screen__inner' => 'transform: translateY(-{{SIZE}}%);', ], 'condition' => [ 'media_landscape_screenshot_scrollable!' => 'scrollable', 'media_landscape_screenshot_align' => 'initial', 'device_orientation_control' => 'yes', 'device_type' => [ 'phone', 'tablet' ], 'device_media_type' => [ 'image' ], 'media_landscape_screenshot[url]!' => '' ] ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_video', [ 'label' => __( 'Video', 'elementor-extras' ), 'condition' => [ 'device_media_type' => 'video', ] ] ); $this->start_controls_tabs( 'tabs_sources' ); $this->start_controls_tab( 'tab_source_mp4', [ 'label' => __( 'MP4', 'elementor-extras' ), 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_source', [ 'label' => __( 'Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'url', 'options' => [ 'url' => __( 'URL', 'elementor-extras' ), 'file' => __( 'File', 'elementor-extras' ), ], ] ); $this->add_control( 'video_url', [ 'label' => __( 'URL', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'condition' => [ 'video_source' => 'url', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_file', [ 'label' => __( 'File', 'elementor-extras' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::MEDIA_CATEGORY, ], ], 'media_type' => 'video', 'condition' => [ 'video_source' => 'file', 'device_media_type' => [ 'video' ], ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_source_m4v', [ 'label' => __( 'M4V', 'elementor-extras' ), 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_source_m4v', [ 'label' => __( 'Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'url', 'options' => [ 'url' => __( 'URL', 'elementor-extras' ), 'file' => __( 'File', 'elementor-extras' ), ], ] ); $this->add_control( 'video_url_m4v', [ 'label' => __( 'URL', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'condition' => [ 'video_source_m4v' => 'url', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_file_m4v', [ 'label' => __( 'File', 'elementor-extras' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::MEDIA_CATEGORY, ], ], 'media_type' => 'video', 'condition' => [ 'video_source_m4v' => 'file', 'device_media_type' => [ 'video' ], ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_source_ogg', [ 'label' => __( 'OGG', 'elementor-extras' ), 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_source_ogg', [ 'label' => __( 'Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'url', 'options' => [ 'url' => __( 'URL', 'elementor-extras' ), 'file' => __( 'File', 'elementor-extras' ), ], ] ); $this->add_control( 'video_url_ogg', [ 'label' => __( 'URL', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'condition' => [ 'video_source_ogg' => 'url', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_file_ogg', [ 'label' => __( 'File', 'elementor-extras' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::MEDIA_CATEGORY, ], ], 'media_type' => 'video', 'condition' => [ 'video_source_ogg' => 'file', 'device_media_type' => [ 'video' ], ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_source_webm', [ 'label' => __( 'WEBM', 'elementor-extras' ), 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_source_webm', [ 'label' => __( 'Source', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'url', 'options' => [ 'url' => __( 'URL', 'elementor-extras' ), 'file' => __( 'File', 'elementor-extras' ), ], ] ); $this->add_control( 'video_url_webm', [ 'label' => __( 'URL', 'elementor-extras' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'condition' => [ 'video_source_webm' => 'url', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_file_webm', [ 'label' => __( 'File', 'elementor-extras' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::MEDIA_CATEGORY, ], ], 'media_type' => 'video', 'condition' => [ 'video_source_webm' => 'file', 'device_media_type' => [ 'video' ], ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'video_cover', [ 'label' => __( 'Choose Cover', 'elementor-extras' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true ], 'separator' => 'before', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'video_cover', 'label' => __( 'Cover Size', 'elementor-extras' ), 'default' => 'large', 'condition' => [ 'video_cover[url]!' => '', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_behaviour_heading', [ 'label' => __( 'Behaviour', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_autoplay', [ 'label' => __( 'Auto Play', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'autoplay', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_autoplay_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => __( 'Many browsers don\'t allow videos with sound to autoplay without user interaction. To avoid this, enable the "Start Muted" control to disable sound so that the video autoplays correctly.', 'elementor-extras' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', 'condition' => [ 'video_autoplay!' => '', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_stop_others', [ 'label' => __( 'Stop Others', 'elementor-extras' ), 'description' => __( 'Stop all other videos on page when this video is played.', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'frontend_available' => true, 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_play_viewport', [ 'label' => __( 'Play in Viewport', 'elementor-extras' ), 'description' => __( 'Autoplay video when the player is in viewport', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_autoplay' => 'autoplay', ], 'frontend_available' => true, ] ); $this->add_control( 'video_stop_viewport', [ 'label' => __( 'Stop on leave', 'elementor-extras' ), 'description' => __( 'Stop video when the player has left the viewport', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_autoplay' => 'autoplay', 'video_play_viewport' => 'yes', ], 'frontend_available' => true, ] ); $this->add_control( 'video_restart_on_pause', [ 'label' => __( 'Restart on pause', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'frontend_available' => true, 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_loop', [ 'label' => __( 'Loop', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'loop', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_end_at_last_frame', [ 'label' => __( 'End at last frame', 'elementor-extras' ), 'description' => __( 'End the video at the last frame instead of showing the first one.', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_loop' => '', ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'video_speed', [ 'label' => __( 'Playback Speed', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'max' => 5, 'min' => 0.1, 'step' => 0.01, ], ], 'condition' => [ 'device_media_type' => [ 'video' ], ], 'frontend_available' => true, ] ); $this->add_control( 'video_display_heading', [ 'label' => __( 'Display', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_show_buttons', [ 'label' => __( 'Show Buttons', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_show_bar', [ 'label' => __( 'Show Bar', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_bar_hide', [ 'label' => __( 'Hide Bar When Playing', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'hide', 'prefix_class' => 'ee-video-player-bar--', 'return_value' => 'hide', 'condition' => [ 'video_show_bar' => 'show', ], ] ); $this->add_control( 'video_show_rewind', [ 'label' => __( 'Show Rewind', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_restart_on_pause!' => 'yes', ], ] ); $this->add_control( 'video_show_time', [ 'label' => __( 'Show Time', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_show_bar!' => '', ] ] ); $this->add_control( 'video_show_progress', [ 'label' => __( 'Show Progress', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_show_bar!' => '', ] ] ); $this->add_control( 'video_show_duration', [ 'label' => __( 'Show Duration', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_show_bar!' => '', ] ] ); $this->add_control( 'video_show_fs', [ 'label' => __( 'Show Fullscreen', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_show_bar!' => '', ], ] ); $this->add_control( 'video_volume_heading', [ 'label' => __( 'Volume', 'elementor-extras' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_show_volume', [ 'label' => __( 'Show Volume', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'device_media_type' => [ 'video' ], 'video_show_bar!' => '', ], ] ); $this->add_control( 'video_show_volume_icon', [ 'label' => __( 'Show Volume Icon', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'video_show_bar!' => '', 'video_show_volume!' => '', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_show_volume_bar', [ 'label' => __( 'Show Volume Bar', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'show', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'show', 'condition' => [ 'video_show_bar!' => '', 'video_show_volume!' => '', 'device_media_type' => [ 'video' ], ], ] ); $this->add_control( 'video_start_muted', [ 'label' => __( 'Start Muted', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'condition' => [ 'video_autoplay!' => '', 'device_media_type' => [ 'video' ], ], ] ); $this->add_responsive_control( 'video_volume', [ 'label' => __( 'Initial Volume', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0.8, ], 'range' => [ 'px' => [ 'max' => 1, 'min' => 0, 'step' => 0.01, ], ], 'condition' => [ 'device_media_type' => [ 'video' ], 'video_start_muted!' => 'yes', ], 'frontend_available' => true, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_device_style', [ 'label' => __( 'Device', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'device_override_style', [ 'label' => __( 'Override Style', 'elementor-extras' ), 'description' => __( 'Override default device style', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'return_value' => 'yes', ] ); $this->add_control( 'device_skin', [ 'label' => __( 'Skin', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'jetblack', 'options' => [ 'jetblack' => __( 'Jet black', 'elementor-extras' ), 'black' => __( 'Black', 'elementor-extras' ), 'silver' => __( 'Silver', 'elementor-extras' ), 'gold' => __( 'Gold', 'elementor-extras' ), 'rosegold' => __( 'Rose Gold', 'elementor-extras' ), ], 'prefix_class' => 'ee-device-skin-', 'condition' => [ 'device_override_style!' => 'yes', 'device_type!' => [ 'laptop', 'desktop' ] ], ] ); $this->add_control( 'device_frame_background', [ 'label' => __( 'Device Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .ee-device-wrapper svg .back-shape' => 'fill: {{VALUE}}', '{{WRAPPER}} .ee-device-wrapper svg .side-shape' => 'fill: {{VALUE}}', ], 'condition' => [ 'device_override_style' => 'yes' ], ] ); $this->add_control( 'device_overlay_tone', [ 'label' => __( 'Tone', 'elementor-extras' ), 'type' => Controls_Manager::SELECT, 'default' => 'light', 'options' => [ 'light' => __( 'Light', 'elementor-extras' ), 'dark' => __( 'Dark', 'elementor-extras' ), ], 'prefix_class' => 'ee-device-controls-tone-', 'condition' => [ 'device_override_style' => 'yes', ], ] ); $this->add_control( 'device_overlay_opacity', [ 'label' => __( 'Opacity (%)', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0.2, ], 'range' => [ 'px' => [ 'max' => 0.4, 'min' => 0.1, 'step' => 0.01, ], ], 'selectors' => [ '{{WRAPPER}} .ee-device-wrapper svg .overlay-shape' => 'fill-opacity: {{SIZE}};', ], 'condition' => [ 'device_override_style' => 'yes' ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_orientation_style', [ 'label' => __( 'Orientation Control', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'device_orientation_control!' => '', ], ] ); $this->start_controls_tabs( 'tabs_orientation_style' ); $this->start_controls_tab( 'orientation_default', [ 'label' => __( 'Default', 'elementor-extras' ), ] ); $this->add_control( 'orientation_color', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ee-device__orientation' => 'color: {{VALUE}}', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'orientation_hover', [ 'label' => __( 'Hover', 'elementor-extras' ), ] ); $this->add_control( 'orientation_color_hover', [ 'label' => __( 'Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ee-device__orientation:hover' => 'color: {{VALUE}}', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_video_style', [ 'label' => __( 'Video', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'device_media_type' => 'video', 'device_type!' => 'window', ], ] ); $this->add_control( 'video_cover_screen', [ 'label' => __( 'Cover Screen', 'elementor-extras' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'return_value' => 'cover', 'label_on' => __( 'Yes', 'elementor-extras' ), 'label_off' => __( 'No', 'elementor-extras' ), 'condition' => [ 'device_media_type' => 'video', 'device_type!' => 'window' , ], 'prefix_class' => 'ee-device-video-', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_screen_style', [ 'label' => __( 'Screen', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'device_media_type' => [ 'image' ], 'device_type' => [ 'window' ], ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'device_screen_border', 'label' => __( 'Border', 'elementor-extras' ), 'selector' => '{{WRAPPER}} .ee-device-wrapper .ee-device__media__screen figure', 'condition' => [ 'device_type' => [ 'window' ], 'device_media_type' => [ 'image' ], ], ] ); $this->add_control( 'device_screen_radius', [ 'label' => __( 'Border Radius', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'allowed_dimensions' => [ 'bottom', 'left' ], 'selectors' => [ '{{WRAPPER}} .ee-device-wrapper .ee-device__media__screen figure' => 'border-radius: 0 0 {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'device_type' => [ 'window' ], 'device_media_type' => [ 'image' ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_video_overlay', [ 'label' => __( 'Video Overlay', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'device_media_type' => 'video', ], ] ); $this->add_control( 'video_overlay_background', [ 'label' => __( 'Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .ee-video-player__cover::after' => 'background-color: {{VALUE}}', ], 'condition' => [ 'device_media_type' => 'video', ], ] ); $this->add_responsive_control( 'video_overlay_opacity', [ 'label' => __( 'Opacity (%)', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0.8, ], 'range' => [ 'px' => [ 'max' => 1, 'min' => 0, 'step' => 0.01, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__cover::after' => 'opacity: {{SIZE}}', ], 'condition' => [ 'device_media_type' => 'video', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', [ 'label' => __( 'Video Interface', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'conditions' => [ 'relation' => 'and', 'terms' => [ [ 'name' => 'device_media_type', 'operator' => '==', 'value' => 'video', ], [ 'relation' => 'or', 'terms' => [ [ 'name' => 'video_show_buttons', 'operator' => '==', 'value' => 'show', ], [ 'name' => 'video_show_bar', 'operator' => '==', 'value' => 'show', ], ], ], ], ], ] ); $this->add_control( 'video_controls_radius', [ 'label' => __( 'Border Radius', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'default' => [ 'top' => 100, 'right' => 100, 'bottom' => 100, 'left' => 100, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar .ee-player__control--progress' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar .ee-player__control--progress__inner' => 'border-radius: 0 {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} 0;' ], ] ); $this->start_controls_tabs( 'tabs_controls_style' ); $this->start_controls_tab( 'video_controls', [ 'label' => __( 'Default', 'elementor-extras' ), ] ); $this->add_control( 'video_controls_foreground', [ 'label' => __( 'Controls Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar' => 'color: {{VALUE}}', '{{WRAPPER}} .ee-video-player__controls .ee-player__control--progress__inner' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'video_controls_background', [ 'label' => __( 'Controls Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '#FFFFFF', 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'video_controls_opacity', [ 'label' => __( 'Controls Opacity (%)', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0.9, ], 'range' => [ 'px' => [ 'max' => 1, 'min' => 0, 'step' => 0.01, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar' => 'opacity: {{SIZE}}', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'video_controls_border', 'label' => __( 'Border', 'elementor-extras' ), 'selector' => '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'video_controls_shadow', 'selector' => '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'video_controls_hover', [ 'label' => __( 'Hover', 'elementor-extras' ), ] ); $this->add_control( 'video_controls_foreground_hover', [ 'label' => __( 'Controls Color', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '(desktop+){{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control:hover, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar:hover' => 'color: {{VALUE}}', '(desktop+){{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar:hover .ee-player__control--progress__inner' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'video_controls_background_hover', [ 'label' => __( 'Controls Background', 'elementor-extras' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '(desktop+){{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control:hover, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar:hover' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'video_controls_opacity_hover', [ 'label' => __( 'Controls Opacity (%)', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'max' => 1, 'min' => 0, 'step' => 0.01, ], ], 'selectors' => [ '(desktop+){{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control:hover, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar:hover' => 'opacity: {{SIZE}}', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'video_controls_border_hover', 'label' => __( 'Border', 'elementor-extras' ), 'selector' => '(desktop+){{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control:hover, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar:hover', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'video_controls_shadow_hover', 'selector' => '(desktop+){{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control:hover, {{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_buttons_style', [ 'label' => __( 'Video Buttons', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'device_media_type' => 'video', 'video_show_buttons!' => '', ], ] ); $this->add_responsive_control( 'video_buttons_size', [ 'label' => __( 'Size (%)', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 60, ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__control' => 'font-size: {{SIZE}}px; width: {{SIZE}}px; height: {{SIZE}}px;', ], 'condition' => [ 'video_show_buttons!' => '', ], ] ); $this->add_responsive_control( 'video_buttons_spacing', [ 'label' => __( 'Controls Spacing', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__overlay .ee-player__controls__rewind' => 'margin-right: {{SIZE}}px;', ], 'condition' => [ 'video_show_buttons!' => '', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_bar_style', [ 'label' => __( 'Video Bar', 'elementor-extras' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'device_media_type' => 'video', 'video_show_bar!' => '', ], ] ); $this->add_responsive_control( 'video_bar_padding', [ 'label' => __( 'Padding', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'max' => 72, 'min' => 0, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar' => 'padding: {{SIZE}}px', ], 'condition' => [ 'video_show_bar!' => '', ], ] ); $this->add_responsive_control( 'video_bar_margin', [ 'label' => __( 'Distance', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'max' => 72, 'min' => 0, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar-wrapper' => 'padding: 0 {{SIZE}}px {{SIZE}}px {{SIZE}}px', ], 'condition' => [ 'video_show_bar!' => '', ], ] ); $this->add_control( 'video_bar_radius', [ 'label' => __( 'Border Radius', 'elementor-extras' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'video_show_bar!' => '', ], ] ); $this->add_responsive_control( 'video_bar_zoom', [ 'label' => __( 'Controls Zoom', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'max' => 36, 'min' => 6, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar' => 'font-size: {{SIZE}}px', '{{WRAPPER}} .ee-video-player__controls .ee-player__controls__bar .ee-player__control--progress' => 'height: {{SIZE}}px', ], 'condition' => [ 'video_show_bar!' => '', ], ] ); $this->add_responsive_control( 'video_bar_spacing', [ 'label' => __( 'Controls Spacing', 'elementor-extras' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '', ], 'range' => [ 'px' => [ 'max' => 24, 'min' => 3, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ee-video-player__controls .ee-player__control--indicator, {{WRAPPER}} .ee-video-player__controls .ee-player__control--icon' => 'padding: 0 {{SIZE}}px', '{{WRAPPER}} .ee-video-player__controls .ee-player__control--progress' => 'margin: 0 {{SIZE}}px', ], 'condition' => [ 'video_show_bar!' => '', ], ] ); $this->end_controls_section(); } /** * Render * * Render widget contents on frontend * * @since 0.1.0 * @return void */ protected function render() { $settings = $this->get_settings_for_display(); // Default to phone $device_type = 'phone'; // Only assign device type if selected if ( ! empty( $settings['device_type'] ) ) { $device_type = $settings['device_type']; } $this->add_render_attribute( [ 'device-wrapper' => [ 'class' => [ 'ee-device-wrapper', 'ee-device-type-' . $device_type, ], ], 'device' => [ 'class' => [ 'ee-device', ], ], 'device-orientation' => [ 'class' => [ 'ee-device__orientation', 'nicon', 'nicon-mobile-landscape', ], ], 'device-shape' => [ 'class' => [ 'ee-device__shape', ], ], 'device-media' => [ 'class' => [ 'ee-device__media', ], ], 'device-media-inner' => [ 'class' => [ 'ee-device__media__inner', ], ], 'device-media-screen' => [ 'class' => [ 'ee-device__media__screen', 'ee-device__media__screen--' . $settings['device_media_type'], ], ], 'device-media-screen-landscape' => [ 'class' => [ 'ee-device__media__screen', 'ee-device__media__screen__landscape', ], ], 'device-media-screen-controls' => [ 'class' => [ 'ee-device__media__screen', 'ee-device__media__screen__controls', ], ], 'device-media-screen-inner' => [ 'class' => [ 'ee-device__media__screen__inner', ], ], ] ); if ( 'yes' === $settings['device_orientation_control'] && 'image' === $settings['device_media_type'] ) { $this->add_render_attribute('device', 'class', 'has--orientation-control'); } ?>