⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278622 in webkit


Ignore:
Timestamp:
Jun 8, 2021, 11:39:39 AM (5 years ago)
Author:
Devin Rousso
Message:

[Modern Media Controls] Don't show Playback Speed when up-to-date Live Boadcasts
https://bugs.webkit.org/show_bug.cgi?id=226744

Reviewed by Eric Carlson.

Source/WebCore:

Test: http/tests/media/modern-media-controls/overflow-support/playback-speed-live-broadcast.html

  • Modules/modern-media-controls/media/overflow-support.js:

(OverflowSupport.prototype.get mediaEvents):
(OverflowSupport.prototype.syncControl):
(OverflowSupport.prototype.get _includePlaybackRates): Added.
Rework existing logic that determines whether to include "Playback Speed" into a separate
function for clarity.

LayoutTests:

  • http/tests/media/modern-media-controls/overflow-support/playback-speed-live-broadcast.html: Added.
  • http/tests/media/modern-media-controls/overflow-support/playback-speed-live-broadcast-expected.txt: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278618 r278622  
     12021-06-08  Devin Rousso  <drousso@apple.com>
     2
     3        [Modern Media Controls] Don't show Playback Speed when up-to-date Live Boadcasts
     4        https://bugs.webkit.org/show_bug.cgi?id=226744
     5
     6        Reviewed by Eric Carlson.
     7
     8        * http/tests/media/modern-media-controls/overflow-support/playback-speed-live-broadcast.html: Added.
     9        * http/tests/media/modern-media-controls/overflow-support/playback-speed-live-broadcast-expected.txt: Added.
     10
    1112021-06-08  Devin Rousso  <drousso@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r278621 r278622  
     12021-06-08  Devin Rousso  <drousso@apple.com>
     2
     3        [Modern Media Controls] Don't show Playback Speed when up-to-date Live Boadcasts
     4        https://bugs.webkit.org/show_bug.cgi?id=226744
     5
     6        Reviewed by Eric Carlson.
     7
     8        Test: http/tests/media/modern-media-controls/overflow-support/playback-speed-live-broadcast.html
     9
     10        * Modules/modern-media-controls/media/overflow-support.js:
     11        (OverflowSupport.prototype.get mediaEvents):
     12        (OverflowSupport.prototype.syncControl):
     13        (OverflowSupport.prototype.get _includePlaybackRates): Added.
     14        Rework existing logic that determines whether to include "Playback Speed" into a separate
     15        function for clarity.
     16
    1172021-06-08  Antti Koivisto  <antti@apple.com>
    218
  • trunk/Source/WebCore/Modules/modern-media-controls/media/overflow-support.js

    r278618 r278622  
    3131    get mediaEvents()
    3232    {
    33         return ["loadstart", "loadedmetadata"];
     33        return [
     34            "abort",
     35            "canplay",
     36            "canplaythrough",
     37            "durationchange",
     38            "emptied",
     39            "error",
     40            "loadeddata",
     41            "loadedmetadata",
     42            "loadstart",
     43            "playing",
     44            "stalled",
     45            "suspend",
     46            "waiting",
     47        ];
    3448    }
    3549
     
    5569        let defaultContextMenuOptions = {};
    5670
    57         if (!this.mediaController.hidePlaybackRates && (!window.MediaStream || !(this.mediaController.media.srcObject instanceof MediaStream)))
     71        if (this._includePlaybackRates)
    5872            defaultContextMenuOptions.includePlaybackRates = true;
    5973
     
    7084    }
    7185
     86    // Private
     87
     88    get _includePlaybackRates()
     89    {
     90        if (this.mediaController.hidePlaybackRates)
     91            return false;
     92
     93        let media = this.mediaController.media;
     94
     95        if (media.duration === Number.POSITIVE_INFINITY && media.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA) {
     96            // Do not allow adjustment of the playback rate for live broadcasts.
     97            return false;
     98        }
     99
     100        if (window.MediaStream && media.srcObject instanceof MediaStream) {
     101            // http://w3c.github.io/mediacapture-main/#mediastreams-in-media-elements
     102            // "playbackRate" - A MediaStream is not seekable.
     103            return false;
     104        }
     105
     106        return true;
     107    }
     108
    72109}
Note: See TracChangeset for help on using the changeset viewer.