---
title: "How to Play videos with iframe in html?"  
description: "How to Play videos with iframe in html?"  
author: "Steilla Mitchel"  
published: 2023-07-21  
updated: 2023-07-21  
canonical: https://www.mindstick.com/forum/159201/how-to-play-videos-with-iframe-in-html  
category: "html"  
tags: ["html", "video"]  
reading_time: 2 minutes  

---

# How to Play videos with iframe in html?

How to Play videos with [iframe](https://www.mindstick.com/forum/1712/how-to-fit-ifrme-in-mobile-browser) in [html](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript)?

## Replies

### Reply by Aryan Kumar

Sure, here is how you can play videos with iframe in HTML:

HTML

```plaintext

```

The `iframe` tag is used to embed another HTML page or external URL into the current page. In this example, we are embedding a YouTube video. The `src` attribute of the `iframe` tag specifies the URL of the video that we want to embed. The `width` and `height` attributes of the `iframe` tag specify the dimensions of the video player.

When the page is loaded, the browser will load the video from YouTube and embed it in the iframe. The user will then be able to play the video by clicking on it.

Here are some additional things to keep in mind when embedding videos with iframe:

- The `src` attribute of the `iframe` tag must point to a valid URL.
- The `width` and `height` attributes of the `iframe` tag must be specified in pixels.
- The `iframe` tag must be placed within a `div` or `span` element.
- You can use the `allow` attribute of the `iframe` tag to specify the features that are allowed in the iframe. For example, you can use the `allowfullscreen` attribute to allow the video to be played in full screen mode.


---

Original Source: https://www.mindstick.com/forum/159201/how-to-play-videos-with-iframe-in-html

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
