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:46:49 -0700
changeset 25871 db15a52a4fd40a48c45cf6f9b831108c7c7599d2
parent 25870 b35ad456cbf6c50475f6e43cf41707d4ed7b2356
child 25872 3bab31a7104fc464bbe1f34386412cd6e38cd6c0
push id1647
push userjdolske@mozilla.com
push dateThu, 04 Jun 2009 21:47:17 +0000
reviewersroc, gavin
bugs496231
milestone1.9.1pre
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.