2.5.16
https://codepen.io/evvvritt/pen/BxmOrN
Toggle Mute with DOM update
Requires two calls to actually unmute the video
I ran into this trying to toggle a mute icon based on the mute state. I tried v-show, :class, and :data-attr changes – all have the same problem :/
Because you shouldn't be unmuting by directly manipulating the DOM. Instead you should mutate the isMuted state and let Vue do it. Vue is doing its job by making sure your DOM is in sync with your state.
Thanks @yyx990803! I should have mentioned that mutating muted attribute via state doesn't work on iOS11 – it pauses the video. By comparison, you can fluidly un/mute by targeting the
https://codepen.io/evvvritt/pen/pVpyzr
I'm trying to have custom video controls, is there an iOS compatible way to achieve this in Vue that I'm missing?
Related:
@evvvritt is right - updating mute/unmute via state works on desktop but not in ios.
I am having this issue also.
If I bind a boolean to a muted prop of the video, it works in desktop Chrome and Firefox but not Safari or Safari on iOS.
If I try to set the video.muted = false on the video via a ref, it doesn't work. Something fishy is certainly going on here.
@michaelpumo I verified that this is due to 2.5.x queueing updates in a macrotask, which causes iOS Safari to consider the operation no longer directly triggered by the user. This should be fixed in upcoming 2.6 which reverts all updates to microtasks.
Most helpful comment
@michaelpumo I verified that this is due to 2.5.x queueing updates in a macrotask, which causes iOS Safari to consider the operation no longer directly triggered by the user. This should be fixed in upcoming 2.6 which reverts all updates to microtasks.