我在构建我的Ooyala播放器并连接控制器后试图获得OoyalaPlayerLayoutController
的高度。我试过了:
getLayout().getHeight()
和
oyalaPlayer.getLayout().getLayoutParams().height
和
playerLayout.getHeight()
每次我获得0
的值。提前谢谢!
答案 0 :(得分:1)
等待玩家状态改变事件
OoyalaPlayer mPlayer;
...
Observable o = new Observer() {
@Override
public void update(Observable observable, Object data) {
trackProgress(mPlayer.getPlayheadPercentage());
Log.wtf("state", mPlayer.getState());
if(mPlayer.getState() == READY)
doMeasure();
}
};
mPlayer.addObservable(o);
btw这里是availbale州的列表
public static enum State {
INIT,
LOADING,
READY,
PLAYING,
PAUSED,
COMPLETED,
SUSPENDED,
ERROR;
private State() {
}
}