package com.ym.zxhcsdk.ads;

import com.ym.zxhcsdk.view.ZXHCRewardVideoAD;

import java.util.ArrayList;
import java.util.List;

public class RewardVideoPlayerUtils {

    public List<ZXHCRewardVideoAD> list = new ArrayList<>();
    public static RewardVideoPlayerUtils rewardVideoPlayerUtils;

    public static RewardVideoPlayerUtils getInstance() {
        if (rewardVideoPlayerUtils == null) {
            rewardVideoPlayerUtils = new RewardVideoPlayerUtils();
        }
        return rewardVideoPlayerUtils;
    }

    public void setVideo(ZXHCRewardVideoAD zxhcRewardVideoAD) {
        list.add(zxhcRewardVideoAD);
    }

    public ZXHCRewardVideoAD getVideo() {
        if (null != list && list.size() > 0) {
            for (int i = 0; i < list.size(); i++) {
                if (list.get(i).isLoadFinish) {
                    return list.get(i);
                }
            }
        }
        return null;
    }
}
