[8.2.4][B2乘客]优化广告播放器使用的单例Key

This commit is contained in:
xinfengkun
2025-09-08 15:16:13 +08:00
parent bac46eddb8
commit adab87fe92
3 changed files with 14 additions and 49 deletions

View File

@@ -120,17 +120,15 @@ class CustomManager : GSYVideoBaseManager() {
}
return customManager
}
/**
* 获取所有指定tag对应的CustomManager
*/
@Synchronized
fun getCustomManagersByTag(tag: String): List<CustomManager> {
if (tag.isBlank()) {
return emptyList()
fun getNullableCustomManager(key: String?): CustomManager? {
if (TextUtils.isEmpty(key)) {
return null
}
return sMap.filterKeys { key ->
key.startsWith(tag)
}.values.toList()
val customManager: CustomManager? = sMap[key]
return customManager
}
fun onPauseAll() {