Reload youtube api
youtube-api
Solution
`onYouTubeIframeAPIReady()` only will be called once per page, when the `window.YT.*` interface is loaded via the external script. Removing the `<script src="http://www.youtube.com/iframe_api">` element from the page and then re-adding it won't trigger `onYouTubeIframeAPIReady()` again.
If you want to destroy the `<iframe>` that contains the upload widget and then create a new widget hosted in a new `<div>` then that should work, but you don't have to do it from within the `onYouTubeIframeAPIReady()` callback the second time. `window.YT.UploadWidget()` is already available at that point, so feel free to use that interface directly from anywhere in your code.
Problem
I need to load, destroy, and reload the YouTube Upload Widget, but unfortunately the reloading it does not work. I performed the following steps: - I loaded the Youtube Upload Widget as described in the howto - works - I capture a video from the webcam - works - I destroy the widget using `widget.destroy(`) - works - I remove the script element from the HTML - works - I reload the API as in step 1 - nothing happens Why isn't this working?