Show correct wireless play placard on iOS.
authorroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Apr 2015 20:39:46 +0000 (20:39 +0000)
committerroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Apr 2015 20:39:46 +0000 (20:39 +0000)
<rdar://problem/20656596>

Copy wireless player placard code from r182631 to iOS.
* Modules/mediacontrols/mediaControlsiOS.css:
(audio::-webkit-media-controls-wireless-playback-status):
(audio::-webkit-media-controls-wireless-playback-text):
(audio::-webkit-media-controls-wireless-playback-text-top):
(audio::-webkit-media-controls-wireless-playback-text-bottom):
(audio::-webkit-media-controls-wireless-playback-status.small):
(audio::-webkit-media-controls-wireless-playback-text-top.small):
(audio::-webkit-media-controls-wireless-playback-text-bottom.small):
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.createControls):
(ControllerIOS.prototype.configureInlineControls):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183127 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css
Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

index 984c8b8..cc97e29 100644 (file)
@@ -1,5 +1,23 @@
 2015-04-22  Roger Fong  <roger_fong@apple.com>
 
+        Show correct wireless play placard on iOS.
+        <rdar://problem/20656596>
+
+        Copy wireless player placard code from r182631 to iOS.
+        * Modules/mediacontrols/mediaControlsiOS.css:
+        (audio::-webkit-media-controls-wireless-playback-status):
+        (audio::-webkit-media-controls-wireless-playback-text):
+        (audio::-webkit-media-controls-wireless-playback-text-top):
+        (audio::-webkit-media-controls-wireless-playback-text-bottom):
+        (audio::-webkit-media-controls-wireless-playback-status.small):
+        (audio::-webkit-media-controls-wireless-playback-text-top.small):
+        (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype.createControls):
+        (ControllerIOS.prototype.configureInlineControls):
+
+2015-04-22  Roger Fong  <roger_fong@apple.com>
+
         Rollout part of r182263 that broke inline media controls on iOS.
         <rdar://problem/20654260>
 
index f4711a3..b4111b4 100644 (file)
@@ -572,12 +572,75 @@ video::-webkit-media-text-track-container i {
 video::-webkit-media-controls-wireless-playback-status,
 audio::-webkit-media-controls-wireless-playback-status {
     display: block;
+    position: absolute;
+    left: 0px;
+    top: 0px;
     width: 100%;
     height: 100%;
+    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 131 90"><g fill="none" stroke="rgb(146,146,146)" stroke-width="4"><rect x="2" y="2" width="127" height="76"/><line x1="30" y1="88" x2="101" y2="88"/></g></svg>');
     background-color: black;
     background-repeat: no-repeat;
-    background-position: 50% 50%;
-    background-size: 100% 50%;
+    background-position: 50% calc(.5 * (100% - 25px) - 21pt);
+    background-size: 131px auto;
+    color: rgb(145,145,145);
+    font: -webkit-small-control;
+    vertical-align: text-bottom;
+}
+
+video::-webkit-media-controls-wireless-playback-text,
+audio::-webkit-media-controls-wireless-playback-text {
+    cursor: default;
+    position: absolute;
+    width: 100%;
+    top: calc(.5 * (100% - 25px) + (.5 * (90px + 42pt) - 42pt));
+    -webkit-user-select: none;
+    margin: 0px;
+    height: 42pt;
+}
+
+video::-webkit-media-controls-wireless-playback-text-top,
+audio::-webkit-media-controls-wireless-playback-text-top {
+    position: absolute;
+    top: 15pt;
+    width: 100%;
+    line-height: 12pt;
+    height: 12pt;
+    font-size: 12pt;
+    text-align: center;
+    margin: 0px;
+}
+
+video::-webkit-media-controls-wireless-playback-text-bottom,
+audio::-webkit-media-controls-wireless-playback-text-bottom {
+    position: absolute;
+    bottom: 0;
+    left: 5%;
+    width: 90%;
+    line-height: 10pt;
+    height: 10pt;
+    font-size: 10pt;
+    text-align: center;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    margin: 0px;
+}
+
+video::-webkit-media-controls-wireless-playback-status.small,
+audio::-webkit-media-controls-wireless-playback-status.small {
+    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 62 43"><g fill="none" stroke="rgb(146,146,146)" stroke-width="2"><rect x="1" y="1" width="60" height="36"/><line x1="14" y1="42" x2="48" y2="42"/></g></svg>');
+    background-position: 50% calc(.5 * (100% - 25px) - 5pt);
+    background-size: 62px auto;
+}
+
+video::-webkit-media-controls-wireless-playback-text-top.small,
+audio::-webkit-media-controls-wireless-playback-text-top.small {
+    top: 4pt;
+}
+
+video::-webkit-media-controls-wireless-playback-text-bottom.small,
+audio::-webkit-media-controls-wireless-playback-text-bottom.small {
+    display: none;
 }
 
 video::-webkit-media-controls-wireless-playback-status.hidden,
index dbe6f3c..2d06e0a 100644 (file)
@@ -115,6 +115,15 @@ ControllerIOS.prototype = {
         spacer.setAttribute('pseudo', '-webkit-media-controls-spacer');
         spacer.classList.add(this.ClassNames.hidden);
 
+        var inlinePlaybackPlaceholderText = this.controls.inlinePlaybackPlaceholderText = document.createElement('div');
+        inlinePlaybackPlaceholderText.setAttribute('pseudo', '-webkit-media-controls-wireless-playback-text');
+
+        var inlinePlaybackPlaceholderTextTop = this.controls.inlinePlaybackPlaceholderTextTop = document.createElement('p');
+        inlinePlaybackPlaceholderTextTop.setAttribute('pseudo', '-webkit-media-controls-wireless-playback-text-top');
+
+        var inlinePlaybackPlaceholderTextBottom = this.controls.inlinePlaybackPlaceholderTextBottom = document.createElement('p');
+        inlinePlaybackPlaceholderTextBottom.setAttribute('pseudo', '-webkit-media-controls-wireless-playback-text-bottom');
+
         var wirelessTargetPicker = this.controls.wirelessTargetPicker
         this.listenFor(wirelessTargetPicker, 'touchstart', this.handleWirelessPickerButtonTouchStart);
         this.listenFor(wirelessTargetPicker, 'touchend', this.handleWirelessPickerButtonTouchEnd);
@@ -170,6 +179,9 @@ ControllerIOS.prototype = {
     },
 
     configureInlineControls: function() {
+        this.controls.inlinePlaybackPlaceholder.appendChild(this.controls.inlinePlaybackPlaceholderText);
+        this.controls.inlinePlaybackPlaceholderText.appendChild(this.controls.inlinePlaybackPlaceholderTextTop);
+        this.controls.inlinePlaybackPlaceholderText.appendChild(this.controls.inlinePlaybackPlaceholderTextBottom);
         this.controls.panel.appendChild(this.controls.playButton);
         this.controls.panel.appendChild(this.controls.statusDisplay);
         this.controls.panel.appendChild(this.controls.spacer);