crowbartools / MixrElixr

Browser extension that enhances your Mixer viewing experience with custom emotes, new features, and a ton of options.
https://mixrelixr.com
GNU General Public License v3.0
23 stars 7 forks source link

changing tabs breaks video hover effect #18

Closed itsjesski closed 6 years ago

itsjesski commented 6 years ago

You'll notice on the who's online page that if you mouse over a stream it replaces the static image with a short video of whats going on.

For some reason if you go to the options page, then back to the who's online page, this hover effects breaks.

ebiggz commented 6 years ago

I fixed this by changing the v-show directive on the video element to v-if. Similarly to Angular, v-show just adds (or removes) 'display:none' to the element style so the element still remains in the dom. Whereas v-if completely removes or adds the element to the dom. Something weird was happening causing the videos to not auto play anymore if we changed tabs so using v-if instead means the video element is refreshed in the dom every time we hover over the element. This also means we dont have hidden video elements playing for every online friend, only for the one we are currently hovering over.