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

object TimeoutUtil {
    interface Listener {
        fun onTimeout(timeout: Boolean)
    }

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

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

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

    fun sendTimeout(timeout: Boolean) {
        for (listener in listeners) {
            listener.onTimeout(timeout)
        }
    }
}