jiajunhui / PlayerBase

The basic library of Android player will process complex business components. The access is simple。Android播放器基础库,专注于播放视图组件的高复用性和组件间的低耦合,轻松处理复杂业务。
Apache License 2.0
2.92k stars 437 forks source link

是否可以提供自定义TimerCounterProxy的能力,或者可以自定义间隔,现在时长1S,在视频比较短的时候,进度条不够平滑 #135

Closed fanwc closed 3 years ago

fanwc commented 3 years ago

我现在是这样做的,希望可以尽快提供官方api

public void setProgressIntervalTime(int intervalTime) {
        try {
            Field player =  mRelationAssist.getClass().getDeclaredField("mPlayer");
            player.setAccessible(true);
            AVPlayer playerValue = (AVPlayer) player.get(mRelationAssist);
            Field timeProxy = playerValue.getClass().getDeclaredField("mTimerCounterProxy");
            timeProxy.setAccessible(true);
            TimerCounterProxy proxyValue = (TimerCounterProxy) timeProxy.get(playerValue);
            Field counterInterval = proxyValue.getClass().getDeclaredField("counterInterval");
            counterInterval.setAccessible(true);
            counterInterval.set(proxyValue,intervalTime);
            long end = System.currentTimeMillis();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
jiajunhui commented 3 years ago

已增加,见最新版本