mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Can't change CEF volume in settings or setBrowserVolume

Open ArranTuna opened this issue 7 years ago • 0 comments

Describe the bug For instance you are playing a youtube video via CEF and you want to lower its volume, but you can't because changing the MTA volume doesn't affect CEF's volume.

myonlake / @patrikjuvonen said: This is somewhat difficult to make in the CWebView class. Mute state or volume state aren't really resetting as supposed to on YouTube for example. This is because we're injecting our JavaScript onto the webpage which might be overriding it. So we're not actually in control.

There is also a comment about this in code:

Since the necessary interfaces of the core audio API were introduced in Win7, we've to fallback to HTML5 audio

Also regarding the mute on minimize feature: we need to store that as a separate boolean because the webpage might have HTML5 elements that already have volume/muted attributes, so we're overriding them upon minimize and volume control unless we have a separate minimize setter/getter.

I suppose if we drop XP support at some point in the future, we'll be able to make this work the right way without the HTML5 "hack".

To Reproduce unstated

Expected behavior Change volume of CEF (settings or setBrowserVolume)

Screenshots If applicable, add screenshots to help explain your problem.

MTA Client (please complete the following information): unstated

MTA Server (please complete the following information): unstated

Additional context

  • https://bugs.mtasa.com/view.php?id=8931
  • Related to https://github.com/multitheftauto/mtasa-blue/issues/1146

ArranTuna avatar Sep 11 '18 21:09 ArranTuna