feat: multi stream audio support
This commit is contained in:
parent
abcf9fcbef
commit
636a56fb7f
15 changed files with 195 additions and 144 deletions
|
@ -511,9 +511,10 @@ class VideoServerPassthrough(private val videoServer: VideoServer) : VideoExtrac
|
|||
override suspend fun extract(): VideoContainer {
|
||||
val vidList = listOfNotNull(videoServer.video?.let { aniVideoToSaiVideo(it) })
|
||||
val subList = videoServer.video?.subtitleTracks?.map { trackToSubtitle(it) } ?: emptyList()
|
||||
val audioList = videoServer.video?.audioTracks ?: emptyList()
|
||||
|
||||
return if (vidList.isNotEmpty()) {
|
||||
VideoContainer(vidList, subList)
|
||||
VideoContainer(vidList, subList, audioList)
|
||||
} else {
|
||||
throw Exception("No videos found")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ani.dantotsu.parsers
|
||||
|
||||
import ani.dantotsu.FileUrl
|
||||
import eu.kanade.tachiyomi.animesource.model.Track
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
|
@ -12,6 +13,7 @@ abstract class VideoExtractor : Serializable {
|
|||
abstract val server: VideoServer
|
||||
var videos: List<Video> = listOf()
|
||||
var subtitles: List<Subtitle> = listOf()
|
||||
var audioTracks: List<Track> = listOf()
|
||||
|
||||
/**
|
||||
* Extracts videos & subtitles from the `embed`
|
||||
|
@ -29,6 +31,7 @@ abstract class VideoExtractor : Serializable {
|
|||
extract().also {
|
||||
videos = it.videos
|
||||
subtitles = it.subtitles
|
||||
audioTracks = it.audioTracks
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +83,8 @@ data class VideoServer(
|
|||
* **/
|
||||
data class VideoContainer(
|
||||
val videos: List<Video>,
|
||||
val subtitles: List<Subtitle> = listOf()
|
||||
val subtitles: List<Subtitle> = listOf(),
|
||||
val audioTracks: List<Track> = listOf(),
|
||||
) : Serializable
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue