<p>Don't have enough reps to comment - but it does not seem to be a Craft issue - but rather a Bootstrap modal issue. It seems like when you open the video, it updates the id of the video.</p>

<p>Based on past experiences - I would look into destroying the modal instance and reloading new content in one modal, as opposed to having multiple modal for multiple content.</p>

<p>Update: Just looked a little more into your code and how it's reacting - it seems like on modal close (of either modals), it updates the value of the video embed code to the varilift-lx video.</p>

<p>^ Caused by scripts.js - Line 2172 - 2174</p>

<pre><code>$('.modal').on('hidden.bs.modal', function () {
    $('.video-container iframe').attr("src", $(".video-container iframe").attr("src"));
});
</code></pre>

<p>It is grabing the first video container and updating it to that value.</p>

CC BY-SA 3.0
2017-05-26T19:45:23.350Z
Normally I'd say "don't comment as an answer", but it appears you've left a legitimate answer. :)
Matt Stein
CC BY-SA 3.0
2017-05-26T23:53:59.300Z
Got it. Created subclasses for .video-container and all is good.
Howard Theriot
CC BY-SA 3.0
2017-05-27T15:07:53.767Z
Hey @HowardTheriot, please consider accepting if JHEUNG's answer was useful.
Matt Stein
CC BY-SA 3.0
2017-05-26T19:28:38.190Z
2017-05-26T20:12:45.700Z
2017-05-26T20:12:45.700Z
JHEUNG
<p>I have two modals with embedded video on this page…
<a href="http://staging.wenzelspine.com/products" rel="nofollow noreferrer">http://staging.wenzelspine.com/products</a></p>

<p>Everything was working fine until I started converting the HTML to Craft templates, but now they are not playing the correct videos… depending on which you click first.</p>

<p>For example, if you load the page and click Play Video under VariLift-LX it is correct, but if you then click Play Video under VariLift-C it plays the VariLift-LX video. If you reload the page and click for VariLift-C first, it plays the correct video.</p>

CC BY-SA 3.0
2017-05-26T19:16:44.187Z
Hi Howard, and welcome to the Craft CMS Stack Exchange site! Can you flesh this question out with your template code, and original HTML too if you think it's relevant?
Matt Stein
<templating><embed>
YouTube embeds playing wrong videos
# YouTube embeds playing wrong videos

(Asked by: username_0 on 2017-05-26)

I have two modals with embedded video on this page…
<http://staging.wenzelspine.com/products>

Everything was working fine until I started converting the HTML to Craft templates, but now they are not playing the correct videos… depending on which you click first.

For example, if you load the page and click Play Video under VariLift-LX it is correct, but if you then click Play Video under VariLift-C it plays the VariLift-LX video. If you reload the page and click for VariLift-C first, it plays the correct video.

**Tags:** templating, embed
> **Comments:**
> **username_1**: Hi Howard, and welcome to the Craft CMS Stack Exchange site! Can you flesh this question out with your template code, and original HTML too if you think it's relevant?  

---

## 1 answers

### Answer by username_2 on 2017-05-26. Score: 2 | Accepted answer

Don't have enough reps to comment - but it does not seem to be a Craft issue - but rather a Bootstrap modal issue. It seems like when you open the video, it updates the id of the video.
Based on past experiences - I would look into destroying the modal instance and reloading new content in one modal, as opposed to having multiple modal for multiple content.
Update: Just looked a little more into your code and how it's reacting - it seems like on modal close (of either modals), it updates the value of the video embed code to the varilift-lx video.
^ Caused by scripts.js - Line 2172 - 2174
$('.modal').on('hidden.bs.modal', function () {
    $('.video-container iframe').attr("src", $(".video-container iframe").attr("src"));
});

It is grabing the first video container and updating it to that value.

> **Comments:**
> **username_1**: Normally I'd say "don't comment as an answer", but it appears you've left a legitimate answer. :)  
> **username_0**: Got it. Created subclasses for .video-container and all is good.  
> **username_1**: Hey @HowardTheriot, please consider accepting if JHEUNG's answer was useful.  

---

