Bug 457964 - changed media paused type to boolean - r+sr=roc
authorChris Double <chris.double@double.co.nz>
Wed, 29 Oct 2008 10:54:17 +1300
changeset 21017 987a6837a42bcb267b2ff8fd8b5181c7fa2edd53
parent 21016 bc8c0c4e7348910ab143a6f8e4a4d35cb94cdc0d
child 21018 6fc233a8263d25c7bd82d3f2b19c0d1b750a19f6
push idunknown
push userunknown
push dateunknown
bugs457964
milestone1.9.1b2pre
Bug 457964 - changed media paused type to boolean - r+sr=roc
content/html/content/src/nsHTMLMediaElement.cpp
dom/public/idl/html/nsIDOMHTMLMediaElement.idl
toolkit/content/widgets/videocontrols.xml
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -307,18 +307,18 @@ NS_IMETHODIMP nsHTMLMediaElement::SetCur
 
 /* readonly attribute float duration; */
 NS_IMETHODIMP nsHTMLMediaElement::GetDuration(float *aDuration)
 {
   *aDuration =  mDecoder ? mDecoder->GetDuration() : 0.0;
   return NS_OK;
 }
 
-/* readonly attribute unsigned short paused; */
-NS_IMETHODIMP nsHTMLMediaElement::GetPaused(PRUint16 *aPaused)
+/* readonly attribute boolean paused; */
+NS_IMETHODIMP nsHTMLMediaElement::GetPaused(PRBool *aPaused)
 {
   *aPaused = mPaused;
 
   return NS_OK;
 }
 
 /* readonly attribute nsIDOMHTMLTimeRanges played; */
 NS_IMETHODIMP nsHTMLMediaElement::GetPlayed(nsIDOMHTMLTimeRanges * *aPlayed)
--- a/dom/public/idl/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/public/idl/html/nsIDOMHTMLMediaElement.idl
@@ -80,17 +80,17 @@ interface nsIDOMHTMLMediaElement : nsIDO
   const unsigned short CAN_PLAY = 2;
   const unsigned short CAN_PLAY_THROUGH = 3;
   readonly attribute unsigned short readyState;
   readonly attribute boolean seeking;
 
   // playback state
            attribute float currentTime;
   readonly attribute float duration;
-  readonly attribute unsigned short paused;
+  readonly attribute boolean paused;
            attribute float defaultPlaybackRate;
            attribute float playbackRate;
   readonly attribute nsIDOMHTMLTimeRanges played;
   readonly attribute nsIDOMHTMLTimeRanges seekable;
   readonly attribute boolean ended;
            attribute boolean autoplay;
   void play();
   void pause();
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -167,18 +167,17 @@
             var video = this.parentNode;
             this.Utils.video = video;
             this.Utils.controls = self;
 
             this.Utils.playButton = document.getAnonymousElementByAttribute(self, "id", "playButton");
             this.Utils.muteButton = document.getAnonymousElementByAttribute(self, "id", "muteButton");
 
             // Set initial state of play/pause button.
-            // XXX (force to a bool, due to bug 457964)
-            this.Utils.playButton.setAttribute("paused", video.paused ? true : false);
+            this.Utils.playButton.setAttribute("paused", video.paused);
 
             function eventBouncer(aEvent) {
                 self.Utils.onMediaEvent(aEvent);
             }
 
             this.style.opacity = 0;
 
             video.addEventListener("play",         eventBouncer, false);