title: AVPlayer seektoTime iPhone
body: <p>I have used seekToTime in my application and its working properly. But I want to have some more information about it. Which is, if I have a streaming video file of 1 minute now I want to play it from second 15th to second 45 (first 15 seconds and the last 15 seconds will not play).</p>
  
  <p>How can I do it?</p>
  
  <p>I know that by use of seekToTime I can play a video from 15th second but how to stop it at 45th second and also get noticed by the method that the video has played for the specified time period?</p>
  
  <pre><code>CMTime timer = CMTimeMake(15, 1);
  [player seekToTime:timer];
  </code></pre>
  
  <p>The above code takes me to the 15th second of the streaming file but how to stop it on 45th second and get notified too?</p>
  
  <p>I have searched a lot but couldn't get any info.</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>As @codeghost suggested, simply use <code>forwardPlaybackEndTime</code>.</p>
  
  <p>You can simply use:</p>
  
  <pre><code>yourAVPlayerItem.forwardPlaybackEndTime = CMTimeMake(10, 1);
  </code></pre>
  
  <p>Here 10 is the time till the AVPlayerItem will play.</p>