[Modern Media Controls] Improve handling of live broadcast video
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2017 20:37:00 +0000 (20:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2017 20:37:00 +0000 (20:37 +0000)
commit286cd9409097e260bd3bb4a0877c074576821e08
treec52a05ade819535fe59163448068da682cb9c272
parent9887012f8973a6f6ddadc7bc8e62b7b5229c7586
[Modern Media Controls] Improve handling of live broadcast video
https://bugs.webkit.org/show_bug.cgi?id=168506
<rdar://problem/30432094>

Patch by Antoine Quint <graouts@apple.com> on 2017-02-17
Reviewed by Dean Jackson.

Source/WebCore:

We improve the handling of live broadcast video by:

    - checking that we have a media source before deciding to show the controls
      bar and start button
    - support a mode where neither the status text nor the scrubber is visible
      in case we're still waiting on sufficient data to determine the video
      time and we haven't really started loading data yet
    - not showing time labels when we have an infinite duration
    - ensuring the status label is left-aligned

Test: media/modern-media-controls/status-label/status-label-text-align.html

* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/status-label.css:
(.status-label):
* Modules/modern-media-controls/controls/status-label.js:
(StatusLabel.prototype.get enabled):
(StatusLabel.prototype.set enabled):
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):
* Modules/modern-media-controls/media/time-labels-support.js:
(TimeLabelsSupport.prototype.syncControl):
(TimeLabelsSupport):

LayoutTests:

Rebase existing tests to match new, correct behavior and add a new test to explicitly
check the text-align property on the status label.

* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio-expected.txt:
* media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label.html:
* media/modern-media-controls/status-label/status-label-font.html:
* media/modern-media-controls/status-label/status-label-text-align-expected.txt: Added.
* media/modern-media-controls/status-label/status-label-text-align.html: Added.
* media/modern-media-controls/status-label/status-label-text-selection.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio-expected.txt
LayoutTests/media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html
LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background-expected.txt
LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label-expected.txt
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label.html
LayoutTests/media/modern-media-controls/status-label/status-label-font.html
LayoutTests/media/modern-media-controls/status-label/status-label-text-align-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/status-label/status-label-text-align.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/status-label/status-label-text-selection.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/status-label.css
Source/WebCore/Modules/modern-media-controls/controls/status-label.js
Source/WebCore/Modules/modern-media-controls/media/controls-visibility-support.js
Source/WebCore/Modules/modern-media-controls/media/status-support.js
Source/WebCore/Modules/modern-media-controls/media/time-labels-support.js