[Media] Audio content shouldn't have fullscreen buttons, even if in a video element
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Dec 2014 10:09:06 +0000 (10:09 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Dec 2014 10:09:06 +0000 (10:09 +0000)
commit7322146b3e7a3f9040327668be21b8338c1dcd02
treec2d108a79f4597a7481bcd31d3fdd69ed8944391
parentefd773c8762737aee6fb04d3b2f6ab96e628a4a2
[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
LayoutTests/ChangeLog
LayoutTests/media/audio-as-video-fullscreen-expected.txt [new file with mode: 0644]
LayoutTests/media/audio-as-video-fullscreen.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.js
Source/WebCore/Modules/mediacontrols/mediaControlsBase.js