Youtube plugin for wordpress?

Good day, please tell me the plugin so you can add the YouTube video thing on the links and they were karuselli + to the bottom of the video you can do a signature!
---
Really need such a thing((
---
Or alternatively I can saorstat it all (but I this piece of code to insert into WordPress in specified location) ?
June 3rd 19 at 19:04
1 answer
June 3rd 19 at 19:06
Solution
Hello!

I implemented something similar using custom fields. The idea is the following:
- install the plugin ACF
- if you need a carousel (slider), you can create a repeater (repeater) and add a field Youtube video (called oEmbed).
- Then add a small code in functions. Need it for parsing the thumbnails desired size for your website from YouTube based on inserted in the reference field.
Here the full set of code for parsing images from different video aggregators:

// Grab the thumbnail of video from oembed
get_video_thumbnail_uri function( $video_uri ) {
 $thumbnail_uri = ";
 // determine the type of video and the video id
 $video = parse_video_uri( $video_uri );
 // get youtube thumbnail
 if ( $video['type'] == 'youtube' )
 $thumbnail_uri = 'https://img.youtube.com/vi/' . $video['id'] . '/mqdefault.jpg';
 // get vimeo thumbnail
 if( $video['type'] == 'vimeo' )
 $thumbnail_uri = get_vimeo_thumbnail_uri( $video['id'] );
 // get wistia thumbnail
 if( $video['type'] == 'wistia' )
 $thumbnail_uri = get_wistia_thumbnail_uri( $video_uri );
 // get default/placeholder thumbnail
 if( empty( $thumbnail_uri ) || is_wp_error( $thumbnail_uri ) )
 $thumbnail_uri = "; 
 //return thumbnail uri
 return $thumbnail_uri;
}
// Parse the video uri/url to determine the video type/source and the video id
parse_video_uri function( $url ) {
 // Parse the url 
 $parse = parse_url( $url ); 
 // Set blank variables
 $video_type = ";
 $video_id = ";
 // Url is http://youtu.be/xxxx
 if ( $parse['host'] == 'youtu.be' ) {
 $video_type = 'youtube';
 $video_id = ltrim( $parse['path'],'/' ); 
}
// Url is http://www.youtube.com/watch?v=xxxx 
// or http://www.youtube.com/watch?feature=player_embedded&v=xxx
// or http://www.youtube.com/embed/xxxx
if ( ( $parse['host'] == 'youtube.com' ) || ( $parse['host'] == 'www.youtube.com' ) ) {
 $video_type = 'youtube';
 parse_str( $parse['query'] );
 $video_id = $v; 
 if ( !empty( $feature ) )
 $video_id = end( explode( 'v=', $parse['query'] ) );
 if ( strpos( $parse['path'], 'embed' ) == 1 )
 $video_id = end( explode( '/', $parse['path'] ) );

}

// Url is http://www.vimeo.com
if ( ( $parse['host'] == 'vimeo.com' ) || ( $parse['host'] == 'www.vimeo.com' ) ) {
 $video_type = 'vimeo';
 $video_id = ltrim( $parse['path'],'/' ); 

}
 $host_names = explode(".", $parse['host'] );
 $rebuild = ( ! empty( $host_names[1] ) ? $host_names[1] : ") . '.' . ( ! empty($host_names[2] ) ? $host_names[2] : ");
// Url is an oembed url wistia.com
if ( ( $rebuild == 'wistia.com' ) || ( $rebuild == 'wi.st.com' ) ) {
 $video_type = 'wistia'; 
 if ( strpos( $parse['path'], 'medias' ) == 1 )
 $video_id = end( explode( '/', $parse['path'] ) );
} 
// If recognised type return video array
if ( !empty( $video_type ) ) {
 $video_array = array('type' => $video_type, 'id' => $video_id);
 return $video_array;
 } else {
 return false;
}

}
//Takes a Vimeo video/clip ID and calls the Vimeo API v2 to get the large thumbnail URL.
get_vimeo_thumbnail_uri function( $clip_id ) {
 $vimeo_api_uri = 'http://vimeo.com/api/v2/video/' . $clip_id . '.php';
 $vimeo_response = wp_remote_get( $vimeo_api_uri );
 if( is_wp_error( $vimeo_response ) ) {
 return $vimeo_response;
 } else {
 $vimeo_response = unserialize( $vimeo_response['body'] );
 return $vimeo_response[0]['thumbnail_large'];
}

}
//Takes a wistia oembed url and gets the video thumbnail url.
get_wistia_thumbnail_uri function( $video_uri ) {
 if ( empty($video_uri) )
 return false;
 $wistia_api_uri = 'http://fast.wistia.com/oembed?url=' . $video_uri;
 $wistia_response = wp_remote_get( $wistia_api_uri );
 if( is_wp_error( $wistia_response ) ) {
 return $wistia_response;
 } else {
 $wistia_response = json_decode( $wistia_response['body'], true );
 return $wistia_response['thumbnail_url'];
}

}


To the question about where to paste the piece of code... and then there is you know better. My site is a custom type of record and, accordingly, I add code to the template custom record type for single-[custom].php

I have it attached to a grid, but the method that I described above, you can use ACF to add to the carousel.
Link to my website where the example code above is - https://md7.info/video

As for roundabouts, then take the FlexSlider2 - flexslider.woothemes.com
P. S. Repeater (repeater) are available in the pro version of the plugin ACF. If you search online, you can find the nulled version... or will buy)
Might suggest - as it is all to put ? - Garth_Macejkovic commented on June 3rd 19 at 19:09
in order to deliver, you should have basic skills in html, css, php, wordpress codex & js.
The steps I wrote above:
1) install the plugin ACF Pro (which is a repeater). Then we create a repeater and add a oEmbed field type.
2) Add function listed above in functions.php
3) Fill in the files of the carousel flexslider to the folder with the theme and attach them using functions.php + optional connect script to initialize the slider
4) Create a page template (or where you plan to bring the slider), add the code of the repeater, and the repeater will vnutni the slides in flexslider. Can include magnific popup below when clicking on each element opens modelka with videos.
5) style by the introduction of css. - rosario.Marv commented on June 3rd 19 at 19:12

Find more questions by tags WordPress