kittsville / GifSound-2

Abandoned remake of gifsound.com with modular media plugins and no server-side code
https://sci1.uk/GifSound-2/
GNU General Public License v2.0
4 stars 1 forks source link

Gifv plugin doesn't clear area between requests #19

Closed kittsville closed 8 years ago

kittsville commented 8 years ago

Since #11 it's been the responsibility of plugins to embed their content into an area that possibly already contains media. This is so that plugins can re-use flash or iFrame embeds rather than spending time creating new ones.

The GifvPlugin is silly and appends itself to the wrapper, meaning any content from a previous embed remains. This can lead to towers of dickbutt gifs, or worse. Offending code: wrapper[0].appendChild(video);

Solution:

wrapper[0].innerHTML = '';
wrapper[0].appendChild(video);

While I could set the innerHTML as video that would cause the video element (and its source children) to be re-parsed and loose all their important event handlers and state.