[Webkit-unassigned] [Bug 185370] New: WKPageSetMediaVolume() API couldn't be used to restore the volume

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 6 21:48:22 PDT 2018


            Bug ID: 185370
           Summary: WKPageSetMediaVolume() API couldn't be used to restore
                    the volume
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: vivek_arumugam at comcast.com

Created attachment 339705

  --> https://bugs.webkit.org/attachment.cgi?id=339705&action=review


The WKPageSetMediaVolume() API takes a floating point input ranging 0-1 which is used as a multiplier against all the media elements of a page thus acts as a master volume control. But however the current implementation doesn't maintain the actual volume set from the upper layers (i.e JS / Media Player App) so every time UI Process calls this API the internal volume gets only reduced thus preventing us to get the previous volume back. Result is this API can't be used to temporarily reduce and restore the volume on demand.

An example scenario is :
* Assume initial volume of HTMLMediaElement is 0.9 & the multiplier (page::mediaVolume()) is 1 (Media player plays with full volume)

* Do WKPageSetMediaVolume(xyz, 0.5)
     * page::mediaVolume() = 0.5
     * HTMLMediaPlayer's m_volume is updated as (m_volume = 0.9 * page->mediaVolume = 0.5) = 0.45

* Do WKPageSetMediaVolume(xyz, 1)
     * page::mediaVolume() = 1
     * HTMLMediaPlayer's m_volume is updated as (m_volume = 0.45 * page->mediaVolume = 1) = 0.45 (volume is still 0.45)

And call WKPageSetMediaVolume(xyz, 0.5) again then the volume gets reduced even lower. I guess this is not the intended behavior. I was trying to fix this with the below patchset.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180507/425509ab/attachment-0001.html>

More information about the webkit-unassigned mailing list