| @@ -5,17 +5,12 @@ | ||
| 5 | 5 | use Averta\Core\Utility\Embed; |
| 6 | 6 | use Depicter\Document\Models; |
| 7 | 7 | use Depicter\Html\Html; |
| 8 | 8 | |
| 9 | -class EmbedVideo extends Models\Element | |
| 10 | -{ | |
| 9 | +class EmbedVideo extends Models\Element{ | |
| 11 | 10 | |
| 12 | 11 | public function render() { |
| 13 | 12 | |
| 14 | -// if ( empty( $this->options->source ) || false == $videoSrc = wp_get_attachment_url( $this->options->source ) ) { | |
| 15 | -// return ''; | |
| 16 | -// } | |
| 17 | - | |
| 18 | 13 | $videoUrl = !empty( $this->options->source ) ? $this->options->source : ''; |
| 19 | 14 | |
| 20 | 15 | $elementsAttrs = [ |
| 21 | 16 | 'data-type' => 'video' |
| @@ -65,9 +60,9 @@ | ||
| 65 | 60 | |
| 66 | 61 | protected function getYouTubeEmbed( $videoUrl ){ |
| 67 | 62 | $embed = ''; |
| 68 | 63 | |
| 69 | - if( $embedUrl = Embed::getYouTubeEmbedUrl( $videoUrl ) ){ | |
| 64 | + if( $embedUrl = Embed::getYouTubeVimeoEmbedUrl( $videoUrl ) ){ | |
| 70 | 65 | $queryParams = []; |
| 71 | 66 | if( isset( $this->options->autoPlay ) ){ |
| 72 | 67 | $queryParams['autoplay'] = (int) $this->options->autoPlay; |
| 73 | 68 | } |
| @@ -99,9 +94,9 @@ | ||
| 99 | 94 | |
| 100 | 95 | protected function getVimeoEmbed( $videoUrl ){ |
| 101 | 96 | $embed = ''; |
| 102 | 97 | |
| 103 | - if( $embedUrl = Embed::getVimeoEmbedUrl( $videoUrl ) ){ | |
| 98 | + if( $embedUrl = Embed::getYouTubeVimeoEmbedUrl( $videoUrl ) ){ | |
| 104 | 99 | |
| 105 | 100 | $queryParams = []; |
| 106 | 101 | |
| 107 | 102 | if( isset( $this->options->autoPlay ) ){ |