gpt4 book ai didi

android - Ooyala Player SDK OoyalaPlayerLayoutController 安卓

转载 作者:行者123 更新时间:2023-11-30 02:03:26 28 4
gpt4 key购买 nike

在构建 Ooyala 播放器并附加 Controller 后,我试图获取 OoyalaPlayerLayoutController 的高度。我试过:

getLayout().getHeight()

和:

oyalaPlayer.getLayout().getLayoutParams().height

和:

playerLayout.getHeight()

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

最佳答案

等待播放器状态改变事件

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);

顺便说一句,这是可用状态的列表

 public static enum State {
INIT,
LOADING,
READY,
PLAYING,
PAUSED,
COMPLETED,
SUSPENDED,
ERROR;

private State() {
}
}

关于android - Ooyala Player SDK OoyalaPlayerLayoutController 安卓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31144884/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com