the total media duration now displays itself correctly at startup. popcorn-port
authorhamidouk
Mon, 02 Jan 2012 12:14:35 +0100
branchpopcorn-port
changeset 559 04e73ddebfa7
parent 558 29a370694c53
child 560 68e91efc5a58
the total media duration now displays itself correctly at startup.
src/js/widgets/playerWidget.js
src/templates/player.html
--- a/src/js/widgets/playerWidget.js	Mon Jan 02 11:46:55 2012 +0100
+++ b/src/js/widgets/playerWidget.js	Mon Jan 02 12:14:35 2012 +0100
@@ -24,7 +24,10 @@
   
   this._Popcorn.listen("volumechange", IriSP.wrap(this, this.muteButtonUpdater));
 
-  this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater));
+  this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater));  
+  // update the time display for the first time.
+  this._Popcorn.listen("loadedmetadata", IriSP.wrap(this, this.timeDisplayUpdater));
+  
   this._Popcorn.listen("IriSP.search.matchFound", IriSP.wrap(this, this.searchMatch));
   this._Popcorn.listen("IriSP.search.noMatchFound", IriSP.wrap(this, this.searchNoMatch));
   
--- a/src/templates/player.html	Mon Jan 02 11:46:55 2012 +0100
+++ b/src/templates/player.html	Mon Jan 02 12:14:35 2012 +0100
@@ -7,9 +7,9 @@
 	</div>	
 	<div class='Ldt-RightPlayerControls'>
     <div class='Ldt-Time'>
-      <div class='Ldt-ElapsedTime'></div>
+      <div class='Ldt-ElapsedTime'>00:00</div>
       <div class='Ldt-TimeSeparator'>/</div>
-      <div class='Ldt-TotalTime'></div>
+      <div class='Ldt-TotalTime'>00:00</div>
     </div>
 		<div class='Ldt-button Ldt-CtrlSound'></div>
 	</div>