1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

update the srs player, set the DAR.

This commit is contained in:
winlin 2013-12-20 18:49:45 +08:00
parent 42ec5f19fc
commit b5c17e2338

View file

@ -77,6 +77,9 @@
$("#btn_dar_4_3").click(function(){ $("#btn_dar_4_3").click(function(){
srs_player.dar(3, 4); srs_player.dar(3, 4);
}); });
$("#btn_dar_fill").click(function(){
srs_player.dar(-1, -1);
});
}); });
/* /*
@ -161,16 +164,26 @@
} }
/* /*
* to set the DAR, for example, DAR=16:9 * to set the DAR, for example, DAR=16:9
* @param num, for example, 9. use metadata height if 0. * @param num, for example, 9.
* @param den, for example, 16. use metadata width if 0. * use metadata height if 0.
* use user specified height if -1.
* @param den, for example, 16.
* use metadata width if 0.
* use user specified width if -1.
*/ */
SrsPlayer.prototype.dar = function(num, den) { SrsPlayer.prototype.dar = function(num, den) {
if (num == 0 && this.metadata) { if (num == 0 && this.metadata) {
num = this.metadata.height; num = this.metadata.height;
} else if (num == -1) {
num = this.height;
} }
if (den == 0 && this.metadata) { if (den == 0 && this.metadata) {
den = this.metadata.width; den = this.metadata.width;
} else if (den == -1) {
den = this.width;
} }
return this.callbackObj.ref.__dar(num, den); return this.callbackObj.ref.__dar(num, den);
} }
SrsPlayer.prototype.on_player_ready = function() { SrsPlayer.prototype.on_player_ready = function() {
@ -254,6 +267,7 @@
<li><a id="btn_dar_21_9" href="#">宽屏影院(21:9)</a></li> <li><a id="btn_dar_21_9" href="#">宽屏影院(21:9)</a></li>
<li><a id="btn_dar_16_9" href="#">宽屏电影(16:9)</a></li> <li><a id="btn_dar_16_9" href="#">宽屏电影(16:9)</a></li>
<li><a id="btn_dar_4_3" href="#">窄屏(4:3)</a></li> <li><a id="btn_dar_4_3" href="#">窄屏(4:3)</a></li>
<li><a id="btn_dar_fill" href="#">填充</a></li>
</ul> </ul>
</div> </div>
<button id="btn_pause" class="btn">暂停</button> <button id="btn_pause" class="btn">暂停</button>