first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
/**
* Video main template
*/
$settings = $this->get_settings_for_display();
$video_url = $this->get_video_url();
if ( empty( $video_url ) ) {
return;
}
$video_html = $this->get_video_html();
if ( empty( $video_html ) ) {
echo $video_url;
return;
}
$data_settings = array(
'lightbox' => filter_var( $settings['lightbox'], FILTER_VALIDATE_BOOLEAN ),
'autoplay' => filter_var( $settings['autoplay'], FILTER_VALIDATE_BOOLEAN ),
);
$this->add_render_attribute( 'wrapper', 'class', 'jet-video' );
$this->add_render_attribute( 'wrapper', 'data-settings', esc_attr( json_encode( $data_settings ) ) );
if ( jet_elements_tools()->is_fa5_migration() ) {
$this->add_render_attribute( 'wrapper', 'class', 'jet-video--fa5-compat' );
}
if ( ! empty( $settings['aspect_ratio'] ) ) {
$this->add_render_attribute( 'wrapper', 'class', 'jet-video-aspect-ratio' );
$this->add_render_attribute( 'wrapper', 'class', 'jet-video-aspect-ratio--' . esc_attr( $settings['aspect_ratio'] ) );
}
if ( $settings['lightbox'] ) {
$this->add_render_attribute( 'wrapper', 'class', 'jet-video--lightbox' );
if ( 'self_hosted' === $settings['video_type'] ) {
$this->add_render_attribute( 'wrapper', 'class', 'jet-video-aspect-ratio' );
$this->add_render_attribute( 'wrapper', 'class', 'jet-video-aspect-ratio--16-9' );
}
}
?>
<div <?php $this->print_render_attribute_string( 'wrapper' ); ?>><?php
if ( ! $settings['lightbox'] ) {
echo $video_html;
}
include $this->__get_global_template( 'overlay' );
?></div>

View File

@@ -0,0 +1,57 @@
<?php
/**
* Overlay template
*/
$thumb_url = $this->get_thumbnail_url();
$video_url = $this->get_video_url();
if ( empty( $thumb_url ) && ! filter_var( $settings['show_play_button'], FILTER_VALIDATE_BOOLEAN ) ) {
return;
}
$this->add_render_attribute( 'overlay', 'class', 'jet-video__overlay' );
if ( ! empty( $thumb_url ) ) {
$this->add_render_attribute( 'overlay', 'class', 'jet-video__overlay--custom-bg' );
$this->add_render_attribute( 'overlay', 'style', sprintf( 'background-image: url(%s);', $thumb_url ) );
}
if ( $settings['lightbox'] ) {
if ( 'self_hosted' === $settings['video_type'] ) {
$lightbox_url = $video_url;
} else {
$lightbox_url = $this->get_lightbox_url();
}
$aspect_ratio = ! empty( $settings['aspect_ratio'] ) ? $settings['aspect_ratio'] : '16-9';
$video_type = ( 'self_hosted' === $settings['video_type'] ) ? 'hosted' : $settings['video_type'];
$lightbox_options = array(
'type' => 'video',
'videoType' => $video_type,
'url' => $lightbox_url,
'modalOptions' => array(
'id' => 'jet-video-lightbox-' . $this->get_id(),
'entranceAnimation' => isset( $settings['lightbox_content_animation'] ) ? $settings['lightbox_content_animation'] : '',
'videoAspectRatio' => str_replace( '-', '', $aspect_ratio ),
),
);
if ( 'self_hosted' === $settings['video_type'] ) {
$lightbox_options['videoParams'] = $this->get_self_hosted_params();
}
$this->add_render_attribute( 'overlay', array(
'data-elementor-open-lightbox' => 'yes',
'data-elementor-lightbox' => json_encode( $lightbox_options ),
) );
}
?>
<div <?php $this->print_render_attribute_string( 'overlay' ); ?>><?php
if ( filter_var( $settings['show_play_button'], FILTER_VALIDATE_BOOLEAN ) ) {
include $this->__get_global_template( 'play-button' );
}
?></div>

View File

@@ -0,0 +1,27 @@
<?php
/**
* Play button template
*/
$this->add_render_attribute( 'play_button', 'class', 'jet-video__play-button' );
$this->add_render_attribute( 'play_button', 'role', 'button' );
if ( ! empty( $settings['play_button_hover_animation'] ) ) {
$this->add_render_attribute( 'play_button', 'class', 'jet-video__play-button--animation-' . esc_attr( $settings['play_button_hover_animation'] ) );
}
?>
<div <?php $this->print_render_attribute_string( 'play_button' ); ?>><?php
if ( 'icon' === $settings['play_button_type'] ) {
$this->__icon( 'play_button_icon', '<span class="jet-elements-icon jet-video__play-button-icon">%s</span>' );
} elseif ( 'image' === $settings['play_button_type'] ) {
echo jet_elements_tools()->get_image_by_url(
$settings['play_button_image']['url'],
array(
'class' => 'jet-video__play-button-image',
'alt' => esc_html__( 'Play Video', 'jet-elements' ),
)
);
} ?>
<span class="elementor-screen-only"><?php esc_html_e( 'Play Video', 'jet-elements' ); ?></span>
</div>