title: How to play the youtube videos with start and end times in both desktop and ios devices
body: <p>i am trying to play youtube videos  with start and end times in both desktop and mobiles(must in safari browser ios).
  I am getting the youtube url  form database like this.</p>
  
  <pre><code>$video_location='http://www.youtube.com/watch?v=2Tvy_Pbe5NA&amp;start=10&amp;end=29';
  </code></pre>
  
  <p>I am using the below code to play the videos.</p>
  
  <pre><code>   if (strpos($video_location,'youtube') !== false)
        {
         $parsedurl = parse_url("$video_location");
         $queryvars = explode("&amp;",$parsedurl["query"]);
         $string1 = str_replace("=","/",$queryvars[0]);
         $string2 = $queryvars[1]."&amp;".$queryvars[2];
         $cleanurl = "http://www.youtube.com/".$string1."&amp;".$string2."&amp;".'version=3';
         $videodata = "&lt;embed width=\"100%\" height=\"400px\" src=\"$cleanurl\"
         type=\"application/x-shockwave-flash\"&gt;
      &lt;/embed&gt;";
        }
        else
        { 
         another condition
        }
  
      above code is working only in desktops with start and end times but in mobile devices start and end times not working properly.thanks!
  </code></pre>