package com.tencent.liteav.demo.superplayer.util

object TimersUtil {
    interface Listener {
        fun onNewTimer(type: Int, value: Int)
    }

    private val listeners: MutableList<Listener> = mutableListOf()

    fun addListener(listener: Listener) {
        listeners.add(listener)
    }

    fun removeListener(listener: Listener) {
        listeners.remove(listener)
    }

    fun sendNewTimer(type: Int, value: Int) {
        for (listener in listeners) {
            listener.onNewTimer(type, value)
        }
    }
}