RESOLVED FIXED Bug 149888
[iOS] <video> elements without audio tracks should not interrupt music
https://bugs.webkit.org/show_bug.cgi?id=149888
Summary [iOS] <video> elements without audio tracks should not interrupt music
Jer Noble
Reported 2015-10-07 12:58:51 PDT
[iOS] <video> elements without audio tracks should not interrupt music
Attachments
Patch (364.89 KB, patch)
2015-10-08 15:54 PDT, Jer Noble
no flags
Patch (365.67 KB, patch)
2015-10-09 16:48 PDT, Jer Noble
no flags
Patch (12.70 KB, patch)
2015-10-30 16:33 PDT, Jer Noble
eric.carlson: review+
jer.noble: commit-queue-
Patch for landing (20.81 KB, patch)
2015-11-02 08:54 PST, Jer Noble
no flags
Patch for landing (364.61 KB, patch)
2015-11-02 09:21 PST, Jer Noble
commit-queue: commit-queue-
Patch for landing (364.60 KB, patch)
2015-11-04 09:37 PST, Jer Noble
no flags
Jer Noble
Comment 1 2015-10-08 15:54:43 PDT
Darin Adler
Comment 2 2015-10-09 09:27:52 PDT
Comment on attachment 262724 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=262724&action=review Not sure exactly why the Mac build is failing. > Source/WebCore/html/HTMLMediaElement.cpp:6450 > +bool HTMLMediaElement::producesAudio() const > +{ > + if (m_player && m_readyState >= HAVE_METADATA) > + return hasAudio(); > + return hasTagName(HTMLNames::audioTag); > +} This function is hard to use correctly. It can return false for a video element and then change its mind and start returning true for the same element as the element loads content. I think it can even return true for an audio element and then start returning false for the same element as the element loads content in some strange cases. What notifies interested parties that this may have changed and it’s time to check it again? It also seems weak design for this to call hasTagName(HTMLNames::audioTag) when we already have separate classes for the audio and video elements. Maybe override this for video element and audio element instead of media element. Maybe a name like “producing audio” would make it a little more clear that this is a state that can change over time. > Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:34 > +#import <UIKit/SoftLinking.h> On the bot: TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:34:9: fatal error: 'UIKit/SoftLinking.h' file not found
Jer Noble
Comment 3 2015-10-09 16:17:44 PDT
(In reply to comment #2) > Comment on attachment 262724 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=262724&action=review > > Not sure exactly why the Mac build is failing. > > > Source/WebCore/html/HTMLMediaElement.cpp:6450 > > +bool HTMLMediaElement::producesAudio() const > > +{ > > + if (m_player && m_readyState >= HAVE_METADATA) > > + return hasAudio(); > > + return hasTagName(HTMLNames::audioTag); > > +} > > This function is hard to use correctly. It can return false for a video > element and then change its mind and start returning true for the same > element as the element loads content. I think it can even return true for an > audio element and then start returning false for the same element as the > element loads content in some strange cases. What notifies interested > parties that this may have changed and it’s time to check it again? Such is the nature of video on the internet; especially with HLS (and also with MSE) video can go from having an audio track to not having one without user intervention. However, we handle this case by re-running PlatformMediaSessionManager::updateSessionState() whenever the hasAudio() or hasVideo() change in HTMLMediaElement::mediaPlayerCharacteristicChanged(). > It also seems weak design for this to call hasTagName(HTMLNames::audioTag) > when we already have separate classes for the audio and video elements. True. > Maybe override this for video element and audio element instead of media > element. > > Maybe a name like “producing audio” would make it a little more clear that > this is a state that can change over time. Sure. > > Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:34 > > +#import <UIKit/SoftLinking.h> > > On the bot: TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:34:9: > fatal error: 'UIKit/SoftLinking.h' file not found I'll try to use one of the WebKit versions of that header.
Jer Noble
Comment 4 2015-10-09 16:48:39 PDT
Darin Adler
Comment 5 2015-10-18 16:53:36 PDT
Comment on attachment 262801 [details] Patch Patch does not build on Mac.
Jer Noble
Comment 6 2015-10-19 08:51:37 PDT
Looks like CanHandleRequest.cpp somehow got re-added to the TestWebKitAPI project (bad merge?). Will fix.
Jer Noble
Comment 7 2015-10-30 16:33:27 PDT
Eric Carlson
Comment 8 2015-10-30 16:36:57 PDT
Comment on attachment 264438 [details] Patch r=me
Jer Noble
Comment 9 2015-11-02 08:53:26 PST
Comment on attachment 264438 [details] Patch Whoops, forgot tests in this patch.
Jer Noble
Comment 10 2015-11-02 08:54:41 PST
Created attachment 264593 [details] Patch for landing
Jer Noble
Comment 11 2015-11-02 09:21:21 PST
Created attachment 264595 [details] Patch for landing
WebKit Commit Bot
Comment 12 2015-11-04 09:35:29 PST
Comment on attachment 264595 [details] Patch for landing Rejecting attachment 264595 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 264595, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/WebCore/ChangeLog contains OOPS!. Full output: http://webkit-queues.webkit.org/results/382217
Jer Noble
Comment 13 2015-11-04 09:37:45 PST
Created attachment 264794 [details] Patch for landing
WebKit Commit Bot
Comment 14 2015-11-04 10:49:42 PST
Comment on attachment 264794 [details] Patch for landing Clearing flags on attachment: 264794 Committed r192027: <http://trac.webkit.org/changeset/192027>
Jer Noble
Comment 15 2015-11-04 16:37:29 PST
Note You need to log in before you can comment on or make changes to this bug.