How to remove component that is empty on dynamic page?

Thanks for getting back, that was actually one of the tutorials I came across to help me hide the embed html component on the dynamic page. But I still get an error message in the console because the component is still technically there with an empty src url. I can get it to hide and collapse if there is no url provided in the dataset. Just wondering if there is a way to completely delete or remove the component from the page onload if the src url is undefined or null? Or if the error is really not a big deal when the site is live?