PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 2.9.1
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v2.9.1
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / public / templates / theme-livestream.php

theme-livestream.php in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels 2.9.1, at public/templates/theme-livestream.php

54 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Theme: Live Stream.
5 *
6 * @link https://plugins360.com
7 * @since 1.6.4
8 *
9 * @package Automatic_YouTube_Gallery
10 */
11
12 $player_width = ! empty( $attributes['player_width'] ) ? (int) $attributes['player_width'] . 'px' : '100%';
13 $player_ratio = ! empty( $attributes['player_ratio'] ) ? (float) $attributes['player_ratio'] : 56.25;
14
15 $featured = $videos[0]; // Featured Video
16 ?>
17 <div id="ayg-<?php echo esc_attr( $attributes['uid'] ); ?>" class="ayg ayg-theme ayg-theme-livestream">
18 <div class="ayg-player">
19 <div class="ayg-player-container" style="max-width: <?php echo $player_width; ?>;">
20 <?php
21 $attributes['poster'] = sprintf( 'https://i.ytimg.com/vi/%s/0.jpg', esc_attr( $featured->id ) );
22
23 if ( isset( $featured->thumbnails->default ) ) {
24 $attributes['poster'] = $featured->thumbnails->default->url;
25 }
26
27 if ( $player_ratio >= 170 ) { // Shorts / Vertical
28 if ( isset( $featured->thumbnails->maxres ) ) {
29 $attributes['poster'] = $featured->thumbnails->maxres->url;
30 } elseif ( isset( $featured->thumbnails->medium ) ) {
31 $attributes['poster'] = $featured->thumbnails->medium->url;
32 } elseif ( isset( $featured->thumbnails->high ) ) {
33 $attributes['poster'] = $featured->thumbnails->high->url;
34 }
35 } elseif ( $player_ratio >= 70 ) { // Classic 4:3
36 if ( isset( $featured->thumbnails->standard ) ) {
37 $attributes['poster'] = $featured->thumbnails->standard->url;
38 } elseif ( isset( $featured->thumbnails->high ) ) {
39 $attributes['poster'] = $featured->thumbnails->high->url;
40 }
41 } else { // Standard 16:9
42 if ( isset( $featured->thumbnails->maxres ) ) {
43 $attributes['poster'] = $featured->thumbnails->maxres->url;
44 } elseif ( isset( $featured->thumbnails->medium ) ) {
45 $attributes['poster'] = $featured->thumbnails->medium->url;
46 }
47 }
48
49 the_ayg_player( $featured, $attributes );
50 ?>
51 </div>
52 </div>
53 </div>
54