embedded.php
4 years ago
external_url.php
4 years ago
html5.php
4 years ago
shortcode.php
4 years ago
video.php
4 years ago
vimeo.php
4 years ago
youtube.php
4 years ago
video.php
36 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display Video |
| 4 | * |
| 5 | * @since v.1.0.0 |
| 6 | * @author themeum |
| 7 | * @url https://themeum.com |
| 8 | * |
| 9 | * @package TutorLMS/Templates |
| 10 | * @version 1.4.3 |
| 11 | */ |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) |
| 14 | exit; |
| 15 | |
| 16 | $video_info = tutor_utils()->get_video_info(); |
| 17 | |
| 18 | do_action('tutor_lesson/single/before/video'); |
| 19 | |
| 20 | $source_key = is_object($video_info) && 'html5' !== $video_info->source ? 'source_'.$video_info->source : null; |
| 21 | |
| 22 | $has_source = (is_object($video_info) && $video_info->source_video_id) || (isset($source_key) ? $video_info->$source_key : null); |
| 23 | |
| 24 | if ($has_source){ |
| 25 | tutor_load_template('single.video.'.$video_info->source); |
| 26 | } else { |
| 27 | $feature_image = get_post_meta( get_the_ID( ), '_thumbnail_id', true ); |
| 28 | $url = $feature_image ? wp_get_attachment_url( $feature_image ) : null; |
| 29 | |
| 30 | if($url) { |
| 31 | echo '<div class="tutor-lesson-feature-image"> |
| 32 | <img src="'.$url.'" /> |
| 33 | </div>'; |
| 34 | } |
| 35 | } |
| 36 | do_action('tutor_lesson/single/after/video'); ?> |