WebKit Bugzilla
Attachment 359969 Details for
Bug 193745
: [iOS] Enable media element volume on iPad
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193745-20190123162053.patch (text/plain), 4.87 KB, created by
Eric Carlson
on 2019-01-23 16:20:55 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2019-01-23 16:20:55 PST
Size:
4.87 KB
patch
obsolete
>Subversion Revision: 240185 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c3a928c7b7959c3f21a0ebfe4ca39d5bf86dbcd0..afdd7386aea8b422a8c21490113cbcc0287bcd6f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-23 Eric Carlson <eric.carlson@apple.com> >+ >+ [iOS] Enable media element volume on iPad >+ https://bugs.webkit.org/show_bug.cgi?id=193745 >+ <rdar://problem/47452297> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::setVolume): >+ (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged): >+ (WebCore::HTMLMediaElement::updateVolume): >+ >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: >+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): >+ > 2019-01-18 Daniel Bates <dabates@apple.com> > > Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174> >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 180c43d1589695d966de0903e9de2b2c4518c30f..91b0f0d653e978065323a3dc6b6fcb5e6c4ca9a6 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -3712,7 +3712,11 @@ ExceptionOr<void> HTMLMediaElement::setVolume(double volume) > if (!(volume >= 0 && volume <= 1)) > return Exception { IndexSizeError }; > >-#if !PLATFORM(IOS_FAMILY) >+#if PLATFORM(IOS_FAMILY) >+ if (!processingUserGestureForMedia()) >+ return { }; >+#endif >+ > if (m_volume == volume) > return { }; > >@@ -3728,7 +3732,7 @@ ExceptionOr<void> HTMLMediaElement::setVolume(double volume) > pauseInternal(); > setAutoplayEventPlaybackState(AutoplayEventPlaybackState::PreventedAutoplay); > } >-#endif >+ > return { }; > } > >@@ -4919,9 +4923,9 @@ void HTMLMediaElement::mediaPlayerVolumeChanged(MediaPlayer*) > > beginProcessingMediaPlayerCallback(); > if (m_player) { >- double vol = m_player->volume(); >- if (vol != m_volume) { >- m_volume = vol; >+ double volume = m_player->volume(); >+ if (volume != m_volume) { >+ m_volume = volume; > updateVolume(); > scheduleEvent(eventNames().volumechangeEvent); > } >@@ -5334,14 +5338,7 @@ void HTMLMediaElement::updateVolume() > { > 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(); >@@ -5370,7 +5367,6 @@ void HTMLMediaElement::updateVolume() > > if (hasMediaControls()) > mediaControls()->changedVolume(); >-#endif > } > > void HTMLMediaElement::scheduleUpdatePlayState() >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index 758c5c48f2d3ba48a6ae7eb39b4c363f6e2b7874..4a73543d5e9af21bdbe10b1c2b4f31dc5db26899 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -305,7 +305,6 @@ SOFT_LINK_OPTIONAL(MediaToolbox, MTEnableCaption2015Behavior, Boolean, (), ()) > #if PLATFORM(IOS_FAMILY) > > #if HAVE(CELESTIAL) >- > SOFT_LINK_PRIVATE_FRAMEWORK(Celestial) > SOFT_LINK_CONSTANT(Celestial, AVController_RouteDescriptionKey_RouteCurrentlyPicked, NSString *) > SOFT_LINK_CONSTANT(Celestial, AVController_RouteDescriptionKey_RouteName, NSString *) >@@ -313,7 +312,6 @@ SOFT_LINK_CONSTANT(Celestial, AVController_RouteDescriptionKey_AVAudioRouteName, > #define AVController_RouteDescriptionKey_RouteCurrentlyPicked getAVController_RouteDescriptionKey_RouteCurrentlyPicked() > #define AVController_RouteDescriptionKey_RouteName getAVController_RouteDescriptionKey_RouteName() > #define AVController_RouteDescriptionKey_AVAudioRouteName getAVController_RouteDescriptionKey_AVAudioRouteName() >- > #endif // HAVE(CELESTIAL) > > #endif // PLATFORM(IOS_FAMILY) >@@ -1382,14 +1380,14 @@ void MediaPlayerPrivateAVFoundationObjC::seekToTime(const MediaTime& time, const > void MediaPlayerPrivateAVFoundationObjC::setVolume(float volume) > { > #if PLATFORM(IOS_FAMILY) >- UNUSED_PARAM(volume); >- return; >-#else >+ if ([[PAL::getUIDeviceClass() currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPad) >+ return; >+#endif >+ > if (!m_avPlayer) > return; > > [m_avPlayer.get() setVolume:volume]; >-#endif > } > > void MediaPlayerPrivateAVFoundationObjC::setMuted(bool muted)
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 193745
: 359969