Title: [241450] trunk/Source/WebCore
- Revision
- 241450
- Author
- eric.carl...@apple.com
- Date
- 2019-02-13 12:34:55 -0800 (Wed, 13 Feb 2019)
Log Message
Revert r240434
https://bugs.webkit.org/show_bug.cgi?id=194600
<rdar://problem/48044566>
Reviewed by Brent Fulgham.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
(WebCore::HTMLMediaElement::updateVolume):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (241449 => 241450)
--- trunk/Source/WebCore/ChangeLog 2019-02-13 20:34:19 UTC (rev 241449)
+++ trunk/Source/WebCore/ChangeLog 2019-02-13 20:34:55 UTC (rev 241450)
@@ -1,3 +1,18 @@
+2019-02-13 Eric Carlson <eric.carl...@apple.com>
+
+ Revert r240434
+ https://bugs.webkit.org/show_bug.cgi?id=194600
+ <rdar://problem/48044566>
+
+ Reviewed by Brent Fulgham.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setVolume):
+ (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
+ (WebCore::HTMLMediaElement::updateVolume):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
+
2019-02-13 Alex Christensen <achristen...@webkit.org>
Stop using setDefersLoading from WebCore
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (241449 => 241450)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2019-02-13 20:34:19 UTC (rev 241449)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2019-02-13 20:34:55 UTC (rev 241450)
@@ -3722,11 +3722,7 @@
if (!(volume >= 0 && volume <= 1))
return Exception { IndexSizeError };
-#if PLATFORM(IOS_FAMILY)
- if (!processingUserGestureForMedia())
- return { };
-#endif
-
+#if !PLATFORM(IOS_FAMILY)
if (m_volume == volume)
return { };
@@ -3742,7 +3738,7 @@
pauseInternal();
setAutoplayEventPlaybackState(AutoplayEventPlaybackState::PreventedAutoplay);
}
-
+#endif
return { };
}
@@ -4933,9 +4929,9 @@
beginProcessingMediaPlayerCallback();
if (m_player) {
- double volume = m_player->volume();
- if (volume != m_volume) {
- m_volume = volume;
+ double vol = m_player->volume();
+ if (vol != m_volume) {
+ m_volume = vol;
updateVolume();
scheduleEvent(eventNames().volumechangeEvent);
}
@@ -5348,7 +5344,14 @@
{
if (!m_player)
return;
-
+#if PLATFORM(IOS_FAMILY)
+ // Only the user can change audio volume so update the cached volume and post the changed event.
+ float volume = m_player->volume();
+ if (m_volume != volume) {
+ m_volume = volume;
+ scheduleEvent(eventNames().volumechangeEvent);
+ }
+#else
// Avoid recursion when the player reports volume changes.
if (!processingMediaPlayerCallback()) {
Page* page = document().page();
@@ -5377,6 +5380,7 @@
if (hasMediaControls())
mediaControls()->changedVolume();
+#endif
}
void HTMLMediaElement::scheduleUpdatePlayState()
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (241449 => 241450)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2019-02-13 20:34:19 UTC (rev 241449)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2019-02-13 20:34:55 UTC (rev 241450)
@@ -1380,14 +1380,15 @@
void MediaPlayerPrivateAVFoundationObjC::setVolume(float volume)
{
#if PLATFORM(IOS_FAMILY)
- if ([[PAL::getUIDeviceClass() currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPad)
- return;
-#endif
+ UNUSED_PARAM(volume);
+ return;
+#else
if (!m_avPlayer)
return;
[m_avPlayer.get() setVolume:volume];
+#endif
}
void MediaPlayerPrivateAVFoundationObjC::setMuted(bool muted)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes