Hey amazing developers,
I've been working on a cool thumbnail grid with an expanding view.
Check out an example here.
Within the expander, I added a video section that retrieves its video ID through an HTML5 data-attribute
. Here's how it looks in HTML:
<div id="test" class="videoPlayer"> iframe code here </div>
My current issue is that if no video ID is defined, I get the Vimeo error iframe (the one that says "Sorry we can't find your video"). Now, I'm trying to find a way to hide that video if the iframe code is present.
if ( document.getElementById('test').innerHTML === 'iframe width="560" height="315" frameborder="0" allowfullscreen="" mozallowfullscreen="" webkitallowfullscreen="" src="http://player.vimeo.com/video/?title=0&byline=0&portrait=0" /iframe' ){
document.getElementById('test').style.display = 'none';
} else {
// do something else
}
I'm not sure if this is even possible, but it's the best solution I could come up with. Thanks a lot in advance!