package com.tencent.liteav.demo.superplayer;

import android.app.Application;

import androidx.annotation.NonNull;

import com.tencent.liteav.demo.superplayer.database.PlayerDatabase;
import com.tencent.liteav.demo.superplayer.database.PlayerDatabaseProvider;
import com.tencent.liteav.demo.superplayer.database.repo.PlayerRepository;
import com.tencent.liteav.demo.superplayer.util.HttpUtils;

public class PlayerApplication extends Application implements PlayerDatabaseProvider {
    private PlayerDatabaseProvider.Instance provider;

    @Override
    public void onCreate() {
        super.onCreate();
        provider = new PlayerDatabaseProvider.Instance(this);
        HttpUtils.INSTANCE.init(this);
    }

    @NonNull
    @Override
    public PlayerDatabase getPlayerDatabase() {
        return provider.getPlayerDatabase();
    }


    @NonNull
    @Override
    public PlayerRepository getPlayerRepository() {
        return provider.getPlayerRepository();
    }
}
