embedded.php
3 years ago
external_url.php
3 years ago
html5.php
3 years ago
shortcode.php
3 years ago
video.php
3 years ago
vimeo.php
3 years ago
youtube.php
3 years ago
youtube.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display YouTube Video |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage Single\Video |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 1.0.0 |
| 10 | */ |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | $disable_default_player_youtube = tutor_utils()->get_option( 'disable_default_player_youtube' ); |
| 17 | $video_info = tutor_utils()->get_video_info(); |
| 18 | $youtube_video_id = tutor_utils()->get_youtube_video_id( tutor_utils()->avalue_dot( 'source_youtube', $video_info ) ); |
| 19 | |
| 20 | do_action( 'tutor_lesson/single/before/video/youtube' ); |
| 21 | ?> |
| 22 | |
| 23 | <?php if ( $youtube_video_id ) : ?> |
| 24 | <div class="tutor-video-player"> |
| 25 | <div class="loading-spinner" area-hidden="true"></div> |
| 26 | <div class="<?php echo $disable_default_player_youtube ? 'plyr__video-embed tutorPlayer' : 'tutor-ratio tutor-ratio-16x9'; ?>"> |
| 27 | <?php if ( ! $disable_default_player_youtube ) : ?> |
| 28 | <iframe src="https://www.youtube.com/embed/<?php echo esc_attr( $youtube_video_id ); ?>" frameborder="0" allowfullscreen allowtransparency allow="autoplay"></iframe> |
| 29 | <?php else : ?> |
| 30 | <iframe src="https://www.youtube.com/embed/<?php echo esc_attr( $youtube_video_id ); ?>?&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1" allowfullscreen allowtransparency allow="autoplay"></iframe> |
| 31 | <?php endif; ?> |
| 32 | </div> |
| 33 | </div> |
| 34 | <?php endif; ?> |
| 35 | |
| 36 | <?php do_action( 'tutor_lesson/single/after/video/youtube' ); ?> |
| 37 |