Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChris Casey
2,374 Points*Tutorial Question: Bootstrap Modal video error
I've been following the Treehouse tutorial "Building a Website with Bootstrap" which has been great. In the last stage, the tutorial covers Modal video and the Footer. After following the tutorial I get an error with the video, in Chrome it only displays half the clip: http://imgur.com/e5V1Swc and in Firefox, nothing: http://imgur.com/IpAlm85 Can anyone help with this? (it does work in IE10!)
Also, when I close the modal I can still hear the video playing in the background - any way to rectify this also?
Thanks
6 Answers
Chris Casey
2,374 PointsHI James Barnett, it was like this when I downloaded the project files from the tutorial here:
It's doing this in the Final folder created by Guil Hernandez. I'm also getting the result after following his tutorial.
Thanks
Guil Hernandez
Treehouse TeacherHey Chris Casey,
I'm taking a look at the files now to see if I can replicate the issue. Thanks!
Chris Casey
2,374 Pointshi Guil Hernandez , did you find an explanation for this?
Thanks in advance
Chris Casey
2,374 PointsFound a remedy for this. Added a class called 'modal_vid' for the link for 'img/thumb_ribbit.jpg' and then included the below script:
<script>
$(".modal_vid, .close").on("click", function() {
$(".modal-dialog iframe").attr("src", $(".modal-dialog iframe").attr("src"));
});
</script>
Chris Dziewa
17,781 PointsThanks for this Chris. This fixed the continuous sound in Chrome after closing but every once in a while the script makes the video load with part of it cut off. Also did you get firefox to work? Mine has always shown the video but when I click play, nothing happens.
Paul Edwards
325 PointsI'm having the same issue, Chris.
Where did you include your script?
Paul Edwards
325 PointsI found this solution but in involves changing the bootstrap.css file directly.
http://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal
My video works well now and sits correctly in the window but it still continues to play once the modal window has been closed. Did you manage to find a fix for that?
Jeesun Kim
4,866 PointsTHANK YOU, YOU SAVED MY LIFE.
James Barnett
39,199 PointsJames Barnett
39,199 PointsHard to help without seeing your code. Create a codepen so we can see the bigger picture.