Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[MediaControls][iOS] Embedded YouTube does not show a 'paused' button…
… state after starting

https://bugs.webkit.org/show_bug.cgi?id=128755

Reviewed by Eric Carlson.

Don't rely on "canPlay()", instead, take the information directly from the event itself. I.e., when
handling the 'play' event, switch mode to playing, and vice versa for the 'pause' event.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handlePlay):
(Controller.prototype.handlePause):
(Controller.prototype.updatePlaying):
(Controller.prototype.setPlaying):

Canonical link: https://commits.webkit.org/146862@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed Feb 14, 2014
1 parent 7b0ce2e commit b8b4fce
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
16 changes: 16 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
2014-02-13 Jer Noble <jer.noble@apple.com>

[MediaControls][iOS] Embedded YouTube does not show a 'paused' button state after starting
https://bugs.webkit.org/show_bug.cgi?id=128755

Reviewed by Eric Carlson.

Don't rely on "canPlay()", instead, take the information directly from the event itself. I.e., when
handling the 'play' event, switch mode to playing, and vice versa for the 'pause' event.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handlePlay):
(Controller.prototype.handlePause):
(Controller.prototype.updatePlaying):
(Controller.prototype.setPlaying):

2014-02-13 Jer Noble <jer.noble@apple.com>

[MediaControls][iOS] Start playback button is visible when playing embedded YouTube
Expand Down
15 changes: 12 additions & 3 deletions Source/WebCore/Modules/mediacontrols/mediaControlsApple.js
Expand Up @@ -517,12 +517,12 @@ Controller.prototype = {

handlePlay: function(event)
{
this.updatePlaying();
this.setPlaying(true);
},

handlePause: function(event)
{
this.updatePlaying();
this.setPlaying(false);
},

handleProgress: function(event)
Expand Down Expand Up @@ -898,7 +898,16 @@ Controller.prototype = {

updatePlaying: function()
{
if (this.canPlay()) {
this.setPlaying(!this.canPlay());
},

setPlaying: function(isPlaying)
{
if (this.isPlaying === isPlaying)
return;
this.isPlaying = isPlaying;

if (!isPlaying) {
this.controls.panel.classList.add(this.ClassNames.paused);
this.controls.playButton.classList.add(this.ClassNames.paused);
this.controls.playButton.setAttribute('aria-label', this.UIString('Play'));
Expand Down

0 comments on commit b8b4fce

Please sign in to comment.