[Media] Audio content shouldn't have fullscreen buttons, even if in a video element
https://bugs.webkit.org/show_bug.cgi?id=139200
<rdar://problem/
18914506>
Reviewed by Eric Carlson.
Source/WebCore:
An audio-only resource, even if loaded into a <video> element, should not
present the fullscreen or optimised fullscreen controls. This includes a
MediaDocument, which is always a <video> element. We can detect this by
examining the length of the videoTracks property as our content loads.
Test: media/audio-as-video-fullscreen.html
* Modules/mediacontrols/mediaControlsApple.js:
(Controller): Initialize a hasVisualMedia to false.
(Controller.prototype.handleReadyStateChange): If we see a videoTrack, hasVisualMedia is now true.
(Controller.prototype.updateFullscreenButtons): Merge the updateFullscreenButton and
updateOptimizedFullscreenButton methods into this single spot, and check for
hasVisualMedia.
(Controller.prototype.updateFullscreenButton): Deleted.
(Controller.prototype.updateOptimizedFullscreenButton): Deleted.
* Modules/mediacontrols/mediaControlsBase.js: Do the same for the other ports.
LayoutTests:
Loads an audio file via the video element and checks if the
fullscreen button is visible.
* media/audio-as-video-fullscreen-expected.txt: Added.
* media/audio-as-video-fullscreen.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176714
268f45cc-cd09-0410-ab3c-
d52691b4dbfc