winlin

update the srs player, set the DAR.

@@ -77,6 +77,9 @@ @@ -77,6 +77,9 @@
77 $("#btn_dar_4_3").click(function(){ 77 $("#btn_dar_4_3").click(function(){
78 srs_player.dar(3, 4); 78 srs_player.dar(3, 4);
79 }); 79 });
  80 + $("#btn_dar_fill").click(function(){
  81 + srs_player.dar(-1, -1);
  82 + });
80 }); 83 });
81 84
82 /* 85 /*
@@ -161,16 +164,26 @@ @@ -161,16 +164,26 @@
161 } 164 }
162 /* 165 /*
163 * to set the DAR, for example, DAR=16:9 166 * to set the DAR, for example, DAR=16:9
164 - * @param num, for example, 9. use metadata height if 0.  
165 - * @param den, for example, 16. use metadata width if 0. 167 + * @param num, for example, 9.
  168 + * use metadata height if 0.
  169 + * use user specified height if -1.
  170 + * @param den, for example, 16.
  171 + * use metadata width if 0.
  172 + * use user specified width if -1.
166 */ 173 */
167 SrsPlayer.prototype.dar = function(num, den) { 174 SrsPlayer.prototype.dar = function(num, den) {
168 if (num == 0 && this.metadata) { 175 if (num == 0 && this.metadata) {
169 num = this.metadata.height; 176 num = this.metadata.height;
  177 + } else if (num == -1) {
  178 + num = this.height;
170 } 179 }
  180 +
171 if (den == 0 && this.metadata) { 181 if (den == 0 && this.metadata) {
172 den = this.metadata.width; 182 den = this.metadata.width;
  183 + } else if (den == -1) {
  184 + den = this.width;
173 } 185 }
  186 +
174 return this.callbackObj.ref.__dar(num, den); 187 return this.callbackObj.ref.__dar(num, den);
175 } 188 }
176 SrsPlayer.prototype.on_player_ready = function() { 189 SrsPlayer.prototype.on_player_ready = function() {
@@ -254,6 +267,7 @@ @@ -254,6 +267,7 @@
254 <li><a id="btn_dar_21_9" href="#">宽屏影院(21:9)</a></li> 267 <li><a id="btn_dar_21_9" href="#">宽屏影院(21:9)</a></li>
255 <li><a id="btn_dar_16_9" href="#">宽屏电影(16:9)</a></li> 268 <li><a id="btn_dar_16_9" href="#">宽屏电影(16:9)</a></li>
256 <li><a id="btn_dar_4_3" href="#">窄屏(4:3)</a></li> 269 <li><a id="btn_dar_4_3" href="#">窄屏(4:3)</a></li>
  270 + <li><a id="btn_dar_fill" href="#">填充</a></li>
257 </ul> 271 </ul>
258 </div> 272 </div>
259 <button id="btn_pause" class="btn">暂停</button> 273 <button id="btn_pause" class="btn">暂停</button>