| Summary: | [iOS] MediaControls: Start Play and Can't Play buttons need to be cutout and blurred | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> | ||||||||||||||
| Component: | Media | Assignee: | Said Abou-Hallawa <sabouhallawa> | ||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||
| Severity: | Normal | CC: | dino | ||||||||||||||
| Priority: | P2 | ||||||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||
| OS: | Unspecified | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Said Abou-Hallawa
2015-06-22 19:30:55 PDT
Created attachment 255390 [details]
Patch
Created attachment 255392 [details]
ios-simulator-screen-shot
Comment on attachment 255390 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255390&action=review > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:245 > +video::-webkit-media-controls-start-playback-button:active video::-webkit-media-controls-start-playback-glyph missing comma > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:250 > +video::-webkit-media-controls-start-playback-button.failed video::-webkit-media-controls-start-playback-glyph missing comma Created attachment 255412 [details]
Patch
I think the size of the playback button on iOS (72x72) is really big (see the screenshot). Also the size of the button is fixed but I think its size should be scaled down if the video/audio element is small. This patch changes the style of the button and I am not sure if I should change the size as well or not. Comment on attachment 255412 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255412&action=review > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:203 > + left: -webkit-calc(50% - 36px); > + top: -webkit-calc(50% - 36px); What’s the significance of moving from calc to webkit-calc? > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:204 > + -webkit-transform: translate3d(0, 0, 0); Is this really needed? > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:216 > + -webkit-transform: translate3d(0, 0, 0); Is this really needed? > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:226 > + -webkit-transform: translate3d(0, 0, 0); Is this really needed? > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:238 > + background-image: url('data:image/svg+xml,<svg viewBox="0 0 144 144" xmlns="http://www.w3.org/2000/svg"><path d="M48,36v74L109,74z" fill="black"/></svg>'); This is 60x60; why is the SVG 144x144? Is there a way to avoid the xmlns here? > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:242 > + -webkit-transform: translate3d(0, 0, 0); Is this really needed? Created attachment 255429 [details]
iso-simulator-screen-shot-without-backdrop-filter
The content of attachment 255392 [details] has been deleted by David Kilzer (:ddkilzer) <ddkilzer@webkit.org> without providing any reason. The token used to delete this attachment was generated at 2015-06-23 17:05:53 PDT. The content of attachment 255429 [details] has been deleted by David Kilzer (:ddkilzer) <ddkilzer@webkit.org> without providing any reason. The token used to delete this attachment was generated at 2015-06-23 17:06:07 PDT. Comment on attachment 255412 [details]
Patch
Working on a work-around fix since the back-drop filter causes the image to be displayed blurred.
Created attachment 256037 [details]
Patch
This patch is the best I can do right now. The glyph of the can't play button is not draw correctly. I am using the clip-path to draw the glyph of the button. The polygon() function does not allow three separate areas to be drawn without connecting them: https://bugs.webkit.org/show_bug.cgi?id=146539. If I draw the glyph using css or an image, either a bitmap or an SVG, the backdrop-filter makes the edges of the image blurred. The css selectors also do not work correctly for the failure case. Also I could not figure out how I get the video to fail loading such that the class ".failed" is added to the play button and the can't play picture is drawn. <rdar://problem/21656127> <rdar://problem/21655685> <rdar://problem/21656923> Created attachment 256339 [details]
Patch
Comment on attachment 256339 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256339&action=review > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:-194 > -audio::-webkit-media-controls-start-playback-button { why are we getting rid of the audio media control support? > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:229 > + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAACMCAMAAACZHrEMAAAABGdBTUEAALGPC/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gmjeywRMM6zofdjYcZi7DG1jLGEw7yYGUsYjKPhd64qxtxYmmJMjqUJJlV+NW6pgzE9lkYY42Opjym+2aHUwKTKOh8HRcJYGktNjOU/sFSNxep75CqMzbH8wOh43KKKeTfybiAUxvpYAoyAsXxh3OSHbcN3MsbCGGOMMcYYY4wxxv57n0aw2iHhyI0VAAAAAElFTkSuQmCC'); Can't we use SVG instead? > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:245 > +*/ Why are we leaving this? Also having ...-button ...-background.active is confusing to me since the state should be associated with the button; not the background nor the glyph. Or is this just a workaround till we get the right fix and have ...-button.active ...-background ...-button.active ...-glyph ...-button.failed ...-background ...-button.failed ...-glyph > Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:254 > + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAACMCAMAAACZHrEMAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACMVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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aControlsiOS.js:473 > + this.controls.startPlaybackButton.querySelector('.webkit-media-controls-start-playback-background').classList.add('active'); Is this part of the workaround? Comment on attachment 256339 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256339&action=review >> Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:-194 >> -audio::-webkit-media-controls-start-playback-button { > > why are we getting rid of the audio media control support? Because audio elements don't have the start-play button. They are always inline. (technically the developer could use an <audio> and point to a video stream, but that's their problem) >> Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:229 >> + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAACMCAMAAACZHrEMAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAA/1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD64ociAAAAVHRSTlMAtCT5hQzkWQHAMPuVEetoAs46/qMZ83UG2Uiw94QL4Ve/LZMQZM04oPFz1keuIfaDCVS+KpDqYsmdGO9yBNVEHn9Ru4znj+ZdpstAIIjpagNDtxJhxoj+AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAdlJREFUeNrt2udSwkAYhWE09iCCsSv2rogdK2LvYjn3fy3mjwaUkqzZ3W+c817BM8yZDyYhkWCMMcYYY4wxxhhjjMVeS6ttQUVw2tptGwIM0NHZZVsRYIDuHtuMCgzcZK9tSIABUn1p25QAA2T6bVsqMPAGBuVggKHhETkYYHRMEAYYt3iSf2EwkZ2UgwGmpgVhgJlZQRi4c/NyMP5JXkjLwQCLS4Iw8JYNn2Q0bGXV6ElGk9bWBWGA3IYgDPKbW3Iw/kneFoQBdnYFYeDuGTjJYTHAfiEtBwMc6D7JUTDwDo/kYIDjk1M5GKB4Jgjjn+SSIAzy55pOsgrGP8kXgjDApY6TrIqBexX/SVbGANeFuB8y/QED3MjB3N6J+WTy2fgfTCpSvPtS7BRVzIOe72+lsej6ZSNjLIoYPWNRw2Qe9VEiYrSNJTpG41giY3JPminhMXrHEgmjeywRMM6zofdjYcZi7DG1jLGEw7yYGUsYjKPhd64qxtxYmmJMjqUJJlV+NW6pgzE9lkYY42Opjym+2aHUwKTKOh8HRcJYGktNjOU/sFSNxep75CqMzbH8wOh43KKKeTfybiAUxvpYAoyAsXxh3OSHbcN3MsbCGGOMMcYYY4wxxv57n0aw2iHhyI0VAAAAAElFTkSuQmCC'); > > Can't we use SVG instead? I only have the source artwork in PNG. And we've decided for this cycle to just use the artwork we're given, even though they could all be SVG. >> Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css:245 >> +*/ > > Why are we leaving this? > Also having > ...-button ...-background.active > is confusing to me since the state should be associated with the button; not the background nor the glyph. Or is this just a workaround till we get the right fix and have > ...-button.active ...-background > ...-button.active ...-glyph > ...-button.failed ...-background > ...-button.failed ...-glyph Yes, I'll remove that commented code. And yes, the confusing .active thing is to work around the bugs you mentioned. I tried selectors that were more correct, but they didn't work :( >> Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js:473 >> + this.controls.startPlaybackButton.querySelector('.webkit-media-controls-start-playback-background').classList.add('active'); > > Is this part of the workaround? Yes. Committed r186487: <http://trac.webkit.org/changeset/186487> |