Ooyala Player SDK OoyalaPlayerLayoutController Android

时间:2015-06-30 17:42:12

标签: android android-layout ooyala

我在构建我的Ooyala播放器并连接控制器后试图获得OoyalaPlayerLayoutController的高度。我试过了:

getLayout().getHeight()

oyalaPlayer.getLayout().getLayoutParams().height

playerLayout.getHeight()

每次我获得0的值。提前谢谢!

1 个答案:

答案 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() {
        }
    }