| | |
| | | $html .= ' poster="' . esc_url($poster_url) . '"'; |
| | | } |
| | | |
| | | $html .= '>'; |
| | | $html .= ' fetch-priority="high">'; |
| | | |
| | | // Add mobile sources first (lower resolution) |
| | | foreach ($mobile_sources as $source) { |
| | | if (!empty($source['url']) && !empty($source['mime'])) { |
| | | $html .= '<source'; |
| | | $html .= ' src="' . esc_url($source['url']) . '"'; |
| | | $html .= ' data-src="' . esc_url($source['url']) . '"'; |
| | | $html .= ' type="' . esc_attr($source['mime']) . '"'; |
| | | $html .= ' media="(max-width: 767px)"'; |
| | | $html .= '>'; |
| | |
| | | foreach ($video_sources as $source) { |
| | | if (!empty($source['url']) && !empty($source['mime'])) { |
| | | $html .= '<source'; |
| | | $html .= ' src="' . esc_url($source['url']) . '"'; |
| | | $html .= ' data-src="' . esc_url($source['url']) . '"'; |
| | | $html .= ' type="' . esc_attr($source['mime']) . '"'; |
| | | |
| | | // Add media query for desktop if mobile sources exist |