add youtube thumbnail in index and single.php add video

To solve this:

1. Add custom meta to each post which take youtube url( name of custom meta in code youtube).

2. In index.php loop:

  while(have_posts()){

    the_post();

   //use [get_post_meta][3] to get youtube post meta
   $youtube_img = 'http://img.youtube.com/vi/'.substr( get_post_meta($post-ID,'youtube') ).'/0.jpg';

   //$youtube_img is your youtube video image url
   echo '<a href="'.get_permalink().'">';
   echo '<img src="'.$youtube_img.'" title="'.get_the_title().'" alt="youtube video image for'.get_the_title().'"/>';
   echo'</a>';
   }

3. In single.php loop (set iframe width as you design need)

<?php
while(have_posts()){
    the_post();

    //use [get_post_meta][3] to get youtube post meta
    $youtube_link = get_post_meta($post-ID,'youtube');   
    ?>    

    //$youtube_link is your youtube url
    <iframe width="328" height="233" src="https://wordpress.stackexchange.com/questions/99840/<?php echo str_replace("watch?v=','embed/', $youtube_link); ?>" frameborder="0" allowfullscreen></iframe>'
    <?php
}