I have a div with a Youtube video embedded via iframe.
-
I was receiving the same error and came to my own solution. I felt that using the old "object" solution for IE9/IE10 was not a true solution because you should never have to code specifically for one browser.
The difference in my situation, I simply needed a video to pop-up, and then stop playing and disappear when close button was clicked.
Using your provided code...
function playVideo() {
$('#video iframe').attr('src', 'http://www.youtube.com/embed/VIDEO_ID_HERE');
$('#video iframe').fadeIn();
}
function stopVideo() {
$('#video iframe').attr('src', '');
$('#video').fadeOut();
}