3.5. Embedding videos into TechDocs


You can use <iframe> elements to embed videos into your TechDocs.

Prerequisites

  • An administrator has configured your AWS S3 bucket to store TechDocs sites.
  • An administrator has configured the appropriate techdocs.sanitizer.allowedIframeHosts and backend.csp settings in your app-config.yaml file.

Procedure

  1. In the section of the TechDocs file that you want to embed a video into, add the following configuration:

    <iframe
      width="<video_width>"
      height="<video_height>"
      src="<video_url>"
      title="<video_title>"
      frameborder="<frame_border>"
      allow="picture-in-picture"
      allowfullscreen>
    </iframe>

    where

    <video_width>
    Specifies the width of the video in number of pixels, for example, 672.
    <video_height>
    Specifies the height of the video in number of pixels, for example, 378.
    <video_url>
    Specifies the url of the video, for example, https://www.youtube.com/watch?v=LB1w8hjBt5k.
    <video_title>
    Specifies the title of the video, for example, Red Hat Developer Hub Overview Video.
    <frame_border>

    Specifies the size of the frame border in number of pixels, for example, 0. Use a value of 0 for no border.

    참고

    TechDocs uses DOMPurify to sanitize HTML. To prevent DOMPurify from removing the <iframe> elements, you must list every permitted video host, such as www.youtube.com, under the techdocs.sanitizer.allowedIframeHosts section of your app-config.yaml file. You must also add the video host to the backend.csp section of your app-config.yaml file.

  2. In the frame-src and allowedIframeHosts fields of your app-config.yaml file, add any video hosts that you want to use. You can add multiple hosts. For example:

    backend:
            csp:
    connect-src: ['https:']
    frame-src: ['https://www.youtube.com/']
    techdocs:
      builder: external
      sanitizer:
        allowedIframeHosts:
          - www.youtube.com
          - <additional_video_host_url>
      publisher:
        type: awsS3
        awsS3:
          bucketName: ${AWS_S3_BUCKET_NAME}
          accountId: ${AWS_ACCOUNT_ID}
          region: ${AWS_REGION}
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동