Diff
Modified: trunk/LayoutTests/ChangeLog (238306 => 238307)
--- trunk/LayoutTests/ChangeLog 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/LayoutTests/ChangeLog 2018-11-16 22:55:26 UTC (rev 238307)
@@ -1,3 +1,16 @@
+2018-11-16 Jeremy Jones <[email protected]>
+
+ Include AirPlay destination name in AirPlay placard.
+ https://bugs.webkit.org/show_bug.cgi?id=191574
+ rdar://problem/45536144
+
+ Reviewed by Eric Carlson.
+
+ Updated tests for string changes.
+
+ * media/modern-media-controls/airplay-placard/airplay-placard-expected.txt:
+ * media/modern-media-controls/airplay-placard/airplay-placard.html:
+
2018-11-16 Ryan Haddad <[email protected]>
REGRESSION (r232376): Layout Test inspector/console/webcore-logging.html is a flaky failure
Modified: trunk/LayoutTests/media/modern-media-controls/airplay-placard/airplay-placard-expected.txt (238306 => 238307)
--- trunk/LayoutTests/media/modern-media-controls/airplay-placard/airplay-placard-expected.txt 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/LayoutTests/media/modern-media-controls/airplay-placard/airplay-placard-expected.txt 2018-11-16 22:55:26 UTC (rev 238307)
@@ -6,7 +6,7 @@
Placard with all parameters
PASS placard.children[0].children[0].iconName is Icons.AirplayPlacard
PASS placard.children[0].children[1].element.innerText is "AirPlay"
-PASS placard.children[0].children[2].element.innerText is "This video is playing on your Apple TV"
+PASS placard.children[0].children[2].element.innerText is "This video is playing on the TV."
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/media/modern-media-controls/airplay-placard/airplay-placard.html (238306 => 238307)
--- trunk/LayoutTests/media/modern-media-controls/airplay-placard/airplay-placard.html 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/LayoutTests/media/modern-media-controls/airplay-placard/airplay-placard.html 2018-11-16 22:55:26 UTC (rev 238307)
@@ -10,7 +10,7 @@
shouldBe("placard.children[0].children[0].iconName", "Icons.AirplayPlacard");
shouldBeEqualToString("placard.children[0].children[1].element.innerText", "AirPlay");
-shouldBeEqualToString("placard.children[0].children[2].element.innerText", "This video is playing on your Apple TV");
+shouldBeEqualToString("placard.children[0].children[2].element.innerText", "This video is playing on the TV.");
</script>
<script src=""
Modified: trunk/Source/WebCore/ChangeLog (238306 => 238307)
--- trunk/Source/WebCore/ChangeLog 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/Source/WebCore/ChangeLog 2018-11-16 22:55:26 UTC (rev 238307)
@@ -1,3 +1,24 @@
+2018-11-16 Jeremy Jones <[email protected]>
+
+ Include AirPlay destination name in AirPlay placard.
+ https://bugs.webkit.org/show_bug.cgi?id=191574
+ rdar://problem/45536144
+
+ Reviewed by Eric Carlson.
+
+ Updated existing tests.
+
+ Include the name of the AirPlay destination in the video element's AirPlay placard.
+
+ * Modules/modern-media-controls/controls/airplay-placard.js:
+ (AirplayPlacard):
+ * Modules/modern-media-controls/controls/placard.js:
+ * Modules/modern-media-controls/media/placard-support.js:
+ (PlacardSupport.prototype._updatePlacard):
+ (PlacardSupport.prototype._updateAirPlayPlacard):
+ (PlacardSupport):
+ * en.lproj/modern-media-controls-localized-strings.js:
+
2018-11-16 Zalan Bujtas <[email protected]>
Add DidFirstMeaningfulPaint milestone.
Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/airplay-placard.js (238306 => 238307)
--- trunk/Source/WebCore/Modules/modern-media-controls/controls/airplay-placard.js 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/airplay-placard.js 2018-11-16 22:55:26 UTC (rev 238307)
@@ -31,7 +31,7 @@
super({
iconName: Icons.AirplayPlacard,
title: UIString("AirPlay"),
- description: UIString("This video is playing on your Apple TV"),
+ description: UIString("This video is playing on the TV."),
layoutDelegate
});
}
Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/placard.js (238306 => 238307)
--- trunk/Source/WebCore/Modules/modern-media-controls/controls/placard.js 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/placard.js 2018-11-16 22:55:26 UTC (rev 238307)
@@ -75,5 +75,11 @@
this._container.children = children;
}
+
+ set description(description)
+ {
+ this._descriptionNode = !!description ? new LayoutNode(`<div class="description">${description}</div>`) : null;
+ this.needsLayout = true;
+ }
}
Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/placard-support.js (238306 => 238307)
--- trunk/Source/WebCore/Modules/modern-media-controls/media/placard-support.js 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/placard-support.js 2018-11-16 22:55:26 UTC (rev 238307)
@@ -62,12 +62,31 @@
let placard = null;
if (media.webkitPresentationMode === "picture-in-picture")
placard = controls.pipPlacard;
- else if (media.webkitCurrentPlaybackTargetIsWireless)
+ else if (media.webkitCurrentPlaybackTargetIsWireless) {
+ this._updateAirPlayPlacard();
placard = controls.airplayPlacard;
- else if (media instanceof HTMLVideoElement && media.error !== null && media.played.length === 0)
+ } else if (media instanceof HTMLVideoElement && media.error !== null && media.played.length === 0)
placard = controls.invalidPlacard;
controls.placard = placard;
}
+
+ _updateAirPlayPlacard()
+ {
+ var deviceName = "";
+
+ if (!this.mediaController.host)
+ return;
+
+ switch(this.mediaController.host.externalDeviceType) {
+ case 'airplay':
+ deviceName = UIString("This video is playing on “%s”.", this.mediaController.host.externalDeviceDisplayName || UIString("Apple TV"));
+ break;
+ case 'tvout':
+ deviceName = UIString("This video is playing on the TV.");
+ break;
+ }
+ this.mediaController.controls.airplayPlacard.description = deviceName;
+ }
}
Modified: trunk/Source/WebCore/en.lproj/modern-media-controls-localized-strings.js (238306 => 238307)
--- trunk/Source/WebCore/en.lproj/modern-media-controls-localized-strings.js 2018-11-16 22:54:21 UTC (rev 238306)
+++ trunk/Source/WebCore/en.lproj/modern-media-controls-localized-strings.js 2018-11-16 22:55:26 UTC (rev 238307)
@@ -1,5 +1,6 @@
const UIStrings = {
"AirPlay": "AirPlay",
+ "Apple TV": "Apple TV",
"Audio": "Audio",
"Audio Controls": "Audio Controls",
"Enter Full Screen": "Enter Full Screen",
@@ -21,7 +22,8 @@
"Skip Forward %s Seconds": "Skip Forward %s Seconds",
"Subtitles": "Subtitles",
"This video is playing in picture in picture.": "This video is playing in picture in picture.",
- "This video is playing on your Apple TV": "This video is playing on your Apple TV",
+ "This video is playing on the TV.": "This video is playing on the TV.",
+ "This video is playing on “%s”.": "This video is playing on “%s”.",
"Unmute": "Unmute",
"Video Controls": "Video Controls",
"Volume Down": "Volume Down",