Translate

How to Embed a Part of any YouTube Video


YouTube is an essential platform for sharing videos across the web, and embedding YouTube videos on websites is a widely-used feature. However, sometimes you may not want to embed the entire video — you just want to show a specific segment. For example:

  • A teacher wants to highlight a 1-minute explanation within a 15-minute tutorial.

  • A blogger wants to share only the punchline of a stand-up routine.

  • A news website wants to quote a short clip from a longer speech.

In this article, we’ll cover multiple ways to embed only a specific portion of a YouTube video — i.e., start and end at specific timestamps.


Method 1: Use YouTube Embed URL Parameters (start and end)

YouTube’s embed player supports two key URL parameters:

  • start: the time in seconds when the video should begin

  • end: the time in seconds when the video should stop

Example Code

<iframe 
  width="560" 
  height="315" 
  src="https://www.youtube.com/embed/VIDEO_ID?start=60&end=90" 
  title="YouTube video player" 
  frameborder="0" 
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
  allowfullscreen>
</iframe>

Replace VIDEO_ID with the actual YouTube video ID.

In this example:

  • start=60 means the video will begin at 1:00 minute.

  • end=90 means the video will stop at 1:30 minutes.

Notes:

  • Times are specified in seconds.

  • The end time is inclusive — playback will stop shortly after reaching this time.

  • Autoplay may be blocked in some browsers unless the user interacts first.


Method 2: Use YouTube’s Share Feature for Start Time (Limited)

YouTube’s default Share feature allows you to set a custom start time, but it does not support end time through the sharing interface.

Steps:

  1. Open the video on YouTube.

  2. Pause at the time you want it to start.

  3. Click the Share button.

  4. Check the box for Start at [timestamp].

  5. Copy the provided URL — it will look like this:
    https://youtu.be/VIDEO_ID?t=90

  6. Convert this to an embed URL:
    https://www.youtube.com/embed/VIDEO_ID?start=90

This works well if you only need a custom start time. For a full segment (start and end), stick to the method in the previous section.


Method 3: Programmatic Control with YouTube IFrame Player API

If you want to embed YouTube video segments with fine-grained control (e.g., automatic pausing at a certain time), the YouTube IFrame Player API offers more flexibility.

Step 1: Load the YouTube API

<script src="https://www.youtube.com/iframe_api"></script>

Step 2: Add a Player Container

<div id="player"></div>

Step 3: Add JavaScript to Control Playback

<script>
  var player;
  var stopTime = 90; // stop at 90 seconds

  function onYouTubeIframeAPIReady() {
    player = new YT.Player('player', {
      height: '390',
      width: '640',
      videoId: 'VIDEO_ID',
      playerVars: {
        autoplay: 1,
        controls: 1,
        start: 60 // start at 60 seconds
      },
      events: {
        'onReady': onPlayerReady,
        'onStateChange': onPlayerStateChange
      }
    });
  }

  function onPlayerReady(event) {
    event.target.playVideo();
  }

  function onPlayerStateChange(event) {
    if (event.data == YT.PlayerState.PLAYING) {
      var interval = setInterval(function () {
        var currentTime = player.getCurrentTime();
        if (currentTime >= stopTime) {
          player.pauseVideo();
          clearInterval(interval);
        }
      }, 500);
    }
  }
</script>

Features:

  • Starts video at 60 seconds.

  • Pauses the video when it hits 90 seconds.

  • Allows user interaction (pause, resume, etc.)

This is ideal for educational platforms, interactive websites, or tools where you need to programmatically define start and stop points.


Method 4: Use Third-Party Tools and Generators (Optional)

There are web tools like:

  • ytcropper.com

  • [TubeChop (defunct but alternatives exist)]

  • [Embed Responsively (for formatting)]

These tools allow users to:

  • Choose the video segment with a visual interface.

  • Generate embeddable iframe codes with start/end logic.

  • Share shortened or embedded URLs.

However, relying on third-party tools may introduce reliability, branding, or privacy issues. It is recommended to use YouTube's official embed features or the API for long-term use.


Additional Tips and Considerations

1. Autoplay Limitations

Modern browsers (especially Chrome and Safari on mobile) block autoplay unless muted or triggered by user interaction. Consider prompting the user to press "play."

2. Using YouTube Shorts

If you want to embed short segments that behave like audio or memes, you can create a YouTube Short and embed that normally.

3. Don't Download or Trim YouTube Videos

Avoid using YouTube downloaders or converters to trim videos offline. This violates YouTube’s Terms of Service. Always use embedding methods that stream directly from YouTube’s servers.

4. Performance Impacts

Even when embedding only a portion of the video, the entire video still loads in the background. If bandwidth or loading speed is a concern, this may not offer real performance savings.


Conclusion

Embedding a specific segment of a YouTube video — rather than the full clip — is a useful and underutilized feature for educators, marketers, and content creators. Whether you’re highlighting a quote, sharing a joke, or embedding an instructional moment, the techniques covered here provide you with both simple and advanced ways to achieve the result:

  • Use URL parameters for quick setups.

  • Use the YouTube API for custom behavior.

  • Avoid downloading or trimming — stay compliant with YouTube’s rules.

With the right approach, you can embed exactly the part of the video you need, with a professional and user-friendly experience.

If you want a tool that automatically generates embed code for start/end time by just entering a URL and timestamps, let me know — I can help build that for your site.