feat: 添加 SourceHandler 接口
This commit is contained in:
19
app/src/main/java/com/videoapp/tv/engine/SourceHandler.kt
Normal file
19
app/src/main/java/com/videoapp/tv/engine/SourceHandler.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.videoapp.tv.engine
|
||||
|
||||
import com.videoapp.tv.data.SearchResult
|
||||
|
||||
interface SourceHandler {
|
||||
val id: String
|
||||
val displayName: String
|
||||
val baseUrl: String
|
||||
|
||||
suspend fun search(
|
||||
keyword: String,
|
||||
onResult: suspend (List<SearchResult>) -> Unit,
|
||||
onError: suspend (String) -> Unit
|
||||
)
|
||||
|
||||
suspend fun extractVideos(detailUrl: String): List<PlaySource>
|
||||
|
||||
suspend fun resolvePlayUrl(playUrl: String): Pair<String?, String?>
|
||||
}
|
||||
Reference in New Issue
Block a user