package com.wdkl.app.ncs.callingbed.helper;

import android.content.Context;
import android.media.AudioManager;

public class RingPlayHelper {

    private static AsyncPlayer ringPlayer;

    public static void playRingTone(Context context, int res, boolean loop) {
        if (ringPlayer == null) {
            ringPlayer = new AsyncPlayer(null);
        }
        ringPlayer.play(context, res, loop, AudioManager.STREAM_MUSIC);
    }

    public static void stopRingTone() {
        if (ringPlayer != null) {
            ringPlayer.stop();
        }
    }
}
