# elementor/trunk/modules/atomic-widgets/elements/atomic-background-video/atomic-background-video-controls/atomic-background-video-controls.php

Elementor Website Builder – more than just a page builder, version trunk. 150 lines.

- Page: https://pluginprobe.com/plugins/elementor/trunk/code/modules/atomic-widgets/elements/atomic-background-video/atomic-background-video-controls/atomic-background-video-controls.php
- Raw: https://pluginprobe.com/plugins/elementor/trunk/raw/modules/atomic-widgets/elements/atomic-background-video/atomic-background-video-controls/atomic-background-video-controls.php
- Modified: 2026-09-01T11:47:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/trunk/code/modules/atomic-widgets/elements/atomic-background-video/atomic-background-video-controls/atomic-background-video-controls.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Background_Video\Atomic_Background_Video_Controls;

use Elementor\Modules\AtomicWidgets\Controls\Section;
use Elementor\Modules\AtomicWidgets\Elements\Atomic_Background_Video\Atomic_Background_Video;
use Elementor\Modules\AtomicWidgets\Elements\Atomic_Background_Video\Atomic_Background_Video_Pause\Atomic_Background_Video_Pause;
use Elementor\Modules\AtomicWidgets\Elements\Atomic_Background_Video\Atomic_Background_Video_Play\Atomic_Background_Video_Play;
use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base;
use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template;
use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer;
use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type;
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
use Elementor\Modules\AtomicWidgets\Styles\Style_States;
use Elementor\Modules\AtomicWidgets\Styles\Style_Variant;
use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Atomic_Background_Video_Controls extends Atomic_Element_Base {
	use Has_Element_Template;

	const BASE_STYLE_KEY = 'base';

	public static $widget_description = 'Controls wrapper for the Background Video element. REQUIRED children: e-background-video-play and e-background-video-pause, each with a required e-paragraph child for the button label.';

	public function __construct( $data = [], $args = null ) {
		parent::__construct( $data, $args );
		$this->meta( 'permanently_locked', true );
	}

	public static function get_type() {
		return 'e-background-video-controls';
	}

	public static function get_element_type(): string {
		return 'e-background-video-controls';
	}

	public function get_title() {
		return esc_html__( 'Controls', 'elementor' );
	}

	public function get_keywords() {
		return [ 'ato', 'atom', 'atoms', 'atomic', 'background', 'video', 'controls' ];
	}

	public function get_icon() {
		return 'eicon-play';
	}

	public function should_show_in_panel() {
		return false;
	}

	public static function get_computed_html_tag( array $settings ): string {
		return Html_Tag_Computer::compute( $settings, 'div' );
	}

	protected static function define_props_schema(): array {
		return [
			'classes' => Classes_Prop_Type::make()->default( [] ),
			'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
		];
	}

	public static function get_props_schema(): array {
		$schema = parent::get_props_schema();

		// Locked sub-element: Display Conditions belong on the Background Video root only.
		unset( $schema['display-conditions'] );

		return $schema;
	}

	protected function define_atomic_controls(): array {
		return [
			Section::make()
				->set_label( __( 'Settings', 'elementor' ) )
				->set_id( 'settings' )
				->set_items( [] ),
		];
	}

	protected function define_atomic_style_states(): array {
		$class_states = Style_States::get_class_states_map();

		return [
			$class_states['playing'],
			$class_states['paused'],
		];
	}

	protected function define_base_styles(): array {
		return [
			static::BASE_STYLE_KEY => Style_Definition::make()
				->add_variant(
					Style_Variant::make()
						->add_props( [
							'display' => String_Prop_Type::generate( 'flex' ),
							'width' => Size_Prop_Type::generate( [
								'size' => 'auto',
								'unit' => 'custom',
							] ),
							'position' => String_Prop_Type::generate( 'absolute' ),
							'inset-block-end' => Size_Prop_Type::generate( [
								'size' => 20,
								'unit' => 'px',
							] ),
							'inset-inline-end' => Size_Prop_Type::generate( [
								'size' => 20,
								'unit' => 'px',
							] ),
							'z-index' => Number_Prop_Type::generate( 2 ),
							'gap' => Size_Prop_Type::generate( [
								'size' => 8,
								'unit' => 'px',
							] ),
						] )
				),
		];
	}

	protected function define_default_children() {
		return [
			Atomic_Background_Video_Play::build_default_element( true ),
			Atomic_Background_Video_Pause::build_default_element( true ),
		];
	}

	protected function define_allowed_child_types() {
		return [
			Atomic_Background_Video::ELEMENT_TYPE_PLAY,
			Atomic_Background_Video::ELEMENT_TYPE_PAUSE,
		];
	}

	protected function get_templates(): array {
		return [
			'elementor/elements/atomic-background-video-controls' => __DIR__ . '/atomic-background-video-controls.html.twig',
		];
	}
}

```
