Bug 496231 - videocontrols don't properly change play button state after video has ended. r=roc, r=gavin, a191=beltzner
authorJustin Dolske <dolske@mozilla.com>
Thu, 04 Jun 2009 14:34:21 -0700
changeset 28940 f4a9e6f39872ab231a570b58a57f7ca42bed1525
parent 28939 b298555c111cddbdf76fb2acd5be658811b53368
child 28941 b53be8993cca28dfa260eb0ae0d54e7a7bd791bd
push id7340
push userjdolske@mozilla.com
push dateThu, 04 Jun 2009 21:34:36 +0000
treeherderautoland@f4a9e6f39872 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, gavin
bugs496231
milestone1.9.2a1pre
Bug 496231 - videocontrols don't properly change play button state after video has ended. r=roc, r=gavin, a191=beltzner
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -508,16 +508,21 @@
                             break;
                         case "suspend":
                             this.setupStatusFader();
                             break;
                         case "timeupdate":
                             var currentTime = Math.round(this.video.currentTime * 1000); // in ms
                             var duration = Math.round(this.video.duration * 1000); // in ms
 
+                            // If playing/seeking after the video ended, we won't get a "play"
+                            // event, so update the button state here.
+                            if (!this.video.paused)
+                                this.setPlayButtonState(false);
+
                             this.timeUpdateCount++;
                             // Whether we show the statusFader sometimes depends
                             // on whether we've seen more than one timeupdate
                             // event (if we haven't, there hasn't been any
                             // "playback activity" and we may wish to show the
                             // statusFader while we wait for HAVE_ENOUGH_DATA).
                             // If we've seen more than 2 timeupdate events,
                             // the count is no longer relevant to setupStatusFader.