WebKit Bugzilla
Attachment 339705 Details for
Bug 185370
: WKPageSetMediaVolume() API couldn't be used to restore the volume
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
.
webkit_master_volume_control.diff (text/plain), 1.97 KB, created by
Vivek Arumugam
on 2018-05-06 21:48:22 PDT
(
hide
)
Description:
.
Filename:
MIME Type:
Creator:
Vivek Arumugam
Created:
2018-05-06 21:48:22 PDT
Size:
1.97 KB
patch
obsolete
>diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 96cf8b9b14a..f6d10dc0c81 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -3648,6 +3648,7 @@ ExceptionOr<void> HTMLMediaElement::setVolume(double volume) > removeBehaviorsRestrictionsAfterFirstUserGesture(MediaElementSession::AllRestrictions & ~MediaElementSession::RequireUserGestureToControlControlsManager); > > m_volume = volume; >+ m_refVolume = m_volume; > m_volumeInitialized = true; > updateVolume(); > scheduleEvent(eventNames().volumechangeEvent); >@@ -4814,6 +4815,9 @@ void HTMLMediaElement::mediaPlayerVolumeChanged(MediaPlayer*) > double vol = m_player->volume(); > if (vol != m_volume) { > m_volume = vol; >+ Page* page = document().page(); >+ if(!page || page->mediaVolume() == 1) >+ m_refVolume = vol; > updateVolume(); > scheduleEvent(eventNames().volumechangeEvent); > } >@@ -5216,6 +5220,7 @@ void HTMLMediaElement::updateVolume() > float volume = m_player->volume(); > if (m_volume != volume) { > m_volume = volume; >+ m_refVolume = volume; > scheduleEvent(eventNames().volumechangeEvent); > } > #else >@@ -5236,7 +5241,7 @@ void HTMLMediaElement::updateVolume() > #endif > > m_player->setMuted(shouldMute); >- m_player->setVolume(m_volume * volumeMultiplier); >+ m_player->setVolume(m_refVolume * volumeMultiplier); > } > > #if ENABLE(MEDIA_SESSION) >diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h >index ba9f59a77c2..55f1afa27b5 100644 >--- a/Source/WebCore/html/HTMLMediaElement.h >+++ b/Source/WebCore/html/HTMLMediaElement.h >@@ -966,6 +966,7 @@ private: > SeekType m_pendingSeekType { NoSeek }; > > double m_volume { 1 }; >+ double m_refVolume { 1 }; > bool m_volumeInitialized { false }; > MediaTime m_lastSeekTime; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185370
:
339705
|
339715
|
339945