Bootstrap 3's responsive embed feature is not functioning as expected

Hey everyone, I'm in the process of building a website with Bootstrap 3 and everything has been going smoothly so far. However, I've run into an issue when trying to embed a YouTube video using the responsive embed class provided by Bootstrap. Despite my best efforts, the video is not showing up on my site. I even tried copying the code directly from the Bootstrap documentation page, but it still isn't working! Can anyone offer some assistance? Here's my code:

<!-- PROMOTIONAL VIDEO -->
<section class="wrap" id="promo-video">
    <div class="container">

    <div class="header-section">
        <h2>Check out the promotional video</h2>
    </div>
        <div class="row">
            <div class="col-sm-8 col-sm-offset-2">
                <!-- 16:9 aspect ratio -->
            <div class="embed-responsive embed-responsive-16by9">
            <iframe class="embed-responsive-item" src="https://www.youtube.com/watch?v=H0uvGe0AhNI"></iframe>
            </div>
            </div><!-- .col -->
        </div><!-- row -->

    </div><!-- .container -->
</section>
<!-- END PROMOTIONAL VIDEO -->

Answer №1

When embedding an IFRAME in your code, make sure the src attribute is correct. It should look like this:

<iframe class="responsive-embed-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe>

Answer №2

You have provided an incorrect input URL...

Here is a suggestion for you to try:

<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe>
</div>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
  <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe>
</div> 

Answer №3

To update the URL, manually delete the section (/watch?v=) and replace it with (/embed/).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can you tell me the name of the unique animated style featured on the new iMac Pro page?

Is it possible to replicate the animation seen on the Apple iMac Pro page using only HTML5 and CSS3? What is this particular type of animation called? Visit the Apple iMac Pro page for reference. ...

Exclude cascading classes in CSS

Help Needed with HTML Lists! <li>A.</li> <li><a href="#">B.</a></li> <li><a class=tr href="#">C.</a></li> <li class=tr>D.</li> <li class=notr>E.</li> I am trying to selec ...

Div sections with a parallax slant

Could you guide me on creating multiple homepage sections with parallax background images and a slanted edge? This is the design I'm aiming for: For reference, I am working on this within Wordpress using the Avada theme as my foundation. ...

Determining the height of dynamically rendered child elements in a React application

Looking for a way to dynamically adjust the heights of elements based on other element heights? Struggling with getting references to the "source" objects without ending up in an infinite loop? Here's what I've attempted so far. TimelineData cons ...

Is it possible to navigate to an anchor within an HTML element that has relative positioning?

Check out the HTML code below: <li name="services"> <h1>Services</h1> <p>text</p> </li> <li name="about"> <h1>About</h1> <p> ...

Building a custom server rack table using PHP and MySQL is a great way to optimize your

I am in the process of developing a rack server using PHP and MySQL. My first task is to set up a dynamic table with rowspan functionality, followed by implementing drag-and-drop features using Ajax. Although I have researched various resources and attemp ...

What is the best way to place a single button above a row using the bootstrap btn-group?

I currently have 11 buttons arranged in 3 rows, and I am trying to position one button at the top as a standalone element before the two rows of buttons. However, despite experimenting with various flex-end and content align classes, I have not been succ ...

Include a parent class within the style tags in your CSS code

Currently, I am facing an issue with a web application that I am developing. On the left side of the page, there is an editable area, and on the right side, there is a live preview. The live preview area contains an HTML file with specific fields that can ...

I am encountering an issue where my Vue navbar is successfully changing the route but not updating the corresponding router-view

I have been working on a single-page application using Vue and I encountered an issue with the navbar when navigating through routes. The problem is that after the first click on a navbar item, the route changes successfully but the router-view does not up ...

Angular Flot Chart Resizing: A Guide to Dynamic Chart S

I have successfully integrated a Flot chart into my HTML using an Angular directive. Here is how it looks: <flot id="placeholder" dataset="dataset" options="options" height="300px" width="100%" style="width:100%;" ng-disabled="graphLoading" ng-class="{ ...

How can I create a grid layout in Bootstrap using columns of sizes 1.5, 8.5, and 2?

Currently working with the bootstrap grid system and facing a dilemma - col-sm-1 is too small, while col-sm-2 is too big for my needs. Is there a way to create something in between like col-sm-1.5 without causing the entire bootstrap grid to collapse? ...

Did I accidentally overlook a tag for this stylish stripe mesh Gradient design?

I've been attempting to replicate the striped animated Gradient mesh using whatamesh.vercel.app. I've set up the JS file, inserted all the gist code into it, and placed everything in the correct locations, but unfortunately, it's not functio ...

"Troubleshooting issue in Django 1.6.2 where CSS styles are not being applied to

I am encountering an issue with this code and would greatly appreciate some assistance. The base.html file contains a {% block content %}{% endblock %}. I have created a Signup.html file structured like this: {%extends 'base.html'%} {% block co ...

The public folder in Node.js is known for its tendency to encounter errors

I'm facing an issue with displaying an icon on my website. Here is the current setup in my code: app.js const http = require('http'); const fs = require('fs'); const express = require('express') const path = require(&apo ...

Ensure the video frame stretches to fit the full width

I am struggling to make my video frame fill the entire width of the screen. Even though I have tried using CSS, the video container does not stretch to the full width as expected. https://i.sstatic.net/kxyE0.png How can I ensure that the video plays acro ...

Find the initial element using the class name to retrieve the CSS properties

.class + p:first-child{ } The code above isn't functioning properly, unless it's an element instead of a class, like p:first-child. <div class="wrap"> <h3></h3> <div style="clear:both"></div> <p></p> & ...

Tips for Positioning Sidebar Elements Relative to Content IDs

My goal is to have sidebar elements align with specific id tags in the main content, rather than just stacking up one after another. I want the sidebar elements to align with certain id tags mentioned in the main post content. The image at shows the basic ...

When utilizing content: url() for a local image, it does not show up, whereas it will display for a web URL. What could be causing this discrepancy

I'm attempting to convert this image into a button. It works fine when acquiring the image through a website URL (not from my own website), but it doesn't work when using a relative path. The image just won't show up. For instance: .my-cla ...

Adjust the source of the HTML5 video tag based on the orientation of an iPad

I am currently coding an HTML5 page specifically for iPad Mobile Safari, which includes a video tag for embedding video files. I have successfully implemented CSS3 media queries to determine the orientation of the iPad. My next challenge is to dynamically ...

What is the best way to incorporate CSS into an AJAX request?

I am facing a challenge in creating a tree menu within my PHP code that is located in an ajax php file. The issue arises due to the presence of classes used inside the tree code: $html .= '<li><span style="min-width:200px" class="folder"> ...