[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Video](../../index.md) > [Step-by-step guides](../index.md) > Videos > Getting an embed code or link

# Getting an embed code or link to a video

{% list tabs group=instructions %}

- Cloud Video UI {#console}

  1. Open the Cloud Video [home page](https://video.yandex.cloud/).
  1. Select a channel.
  1. In the ![video](../../../_assets/console-icons/circle-play.svg) **Video** tab, select the video.
  1. Under **Past code**:

      1. Set the required playback parameters for the video:

          1. `Play video without sound by default`
          1. `Auto play video`
          1. `Display controls in the player`.

          With [Cloud Video Player SDK for IFrame](../../sdk/iframe/index.md), you can specify additional player control and video playback settings for an HTML page, e.g., video size and looping, volume, etc.

      1. Select the preferred video link format:

          * `html`: HTML embed code in Iframe format.
          * `link`: Direct link to the video.

      1. Click ![copy](../../../_assets/console-icons/copy.svg) **Copy**.

- REST API {#api}

  Run this command:

  ```bash
  curl \
    --request GET \
    --header 'Authorization: Bearer <IAM_token>' \
    --url 'https://video.api.cloud.yandex.net/video/v1/videos/<video_ID>:getPlayerURL'
  ```

  Where:
  * `<IAM_token>`: [IAM token](../../../iam/concepts/authorization/iam-token.md) required for [authenticating](../../api-ref/authentication.md) with the Cloud Video API.
  * `<video_ID>`: ID of the video you want to get a link to.

  Result:
  
  ```text
  {
    "playerUrl": "https://runtime.video.cloud.yandex.net/player/video/vplva3626rvh********?autoplay=0\u0026mute=0",
    "html": "\u003ciframe width=\"560\" height=\"315\" src=\"https://runtime.video.cloud.yandex.net/player/video/vplva3626rvh********?autoplay=0\u0026mute=0\" allow=\"autoplay; fullscreen; accelerometer; gyroscope; picture-in-picture; encrypted-media\" frameborder=\"0\" scrolling=\"no\"\u003e\u003c/iframe\u003e"
  }
  ```
  
  Where:
  * `playerUrl`: Direct link to the video.
  * `html`: HTML embed code in Iframe format.

- gRPC API {#grpc-api}

  Run this command:

  ```bash
  grpcurl \
    -rpc-header "Authorization: Bearer <IAM_token>" \
    -d '{
      "videoId": "<video_ID>"
    }' \
    video.api.cloud.yandex.net:443 yandex.cloud.video.v1.VideoService/GetPlayerURL
  ```

  Where:
  * `<IAM_token>`: [IAM token](../../../iam/concepts/authorization/iam-token.md) required for [authenticating](../../api-ref/authentication.md) with the Cloud Video API.
  * `<video_ID>`: ID of the video you want to get a link to.

  Result:
  
  ```text
  {
    "playerUrl": "https://runtime.video.cloud.yandex.net/player/video/vplva3626rvh********?autoplay=0\u0026mute=0",
    "html": "\u003ciframe width=\"560\" height=\"315\" src=\"https://runtime.video.cloud.yandex.net/player/video/vplva3626rvh********?autoplay=0\u0026mute=0\" allow=\"autoplay; fullscreen; accelerometer; gyroscope; picture-in-picture; encrypted-media\" frameborder=\"0\" scrolling=\"no\"\u003e\u003c/iframe\u003e"
  }
  ```
  
  Where:
  * `playerUrl`: Direct link to the video.
  * `html`: HTML embed code in Iframe format.

{% endlist %}

{% note tip %}

To make the whole thumbnail fit in the window regardless of screen resolution when uploading the video in browser, add the `&object_fit=contain` parameter to the end of the link.

If this parameter is not specified in the link, the default `object_fit=cover` value will be used.

Learn more about the `object_fit` parameter in [this CSS guide](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit).

{% endnote %}