onYouTubeIframeAPIReady() will only be called once per page when the window.YT.* interface is loaded through an external script. Removing the <script src="http://www.youtube.com/iframe_api"> element from the page and then re-adding it will not onYouTubeIframeAPIReady() again.
If you want to destroy the <iframe> that contains the download widget, then create a new widget placed in the new <div> that should work, but you shouldn't do it inside the onYouTubeIframeAPIReady() callback a second time. window.YT.UploadWidget() already available in this place, so feel free to use this interface directly from anywhere in your code.
source share