implement audio tracks backend

This commit is contained in:
Bnyro 2022-11-16 10:40:48 +01:00
parent f86ca78ea5
commit d0ef111c2d
6 changed files with 28 additions and 1 deletions

View File

@ -17,5 +17,7 @@ data class PipedStream(
var indexEnd: Int? = null,
var width: Int? = null,
var height: Int? = null,
var fps: Int? = null
var fps: Int? = null,
val audioTrackName: String? = null,
val audioTrackId: String? = null
)

View File

@ -1407,6 +1407,10 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
.show(childFragmentManager)
}
override fun onAudioStreamClicked() {
TODO("Not yet implemented")
}
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
super.onPictureInPictureModeChanged(isInPictureInPictureMode)
if (isInPictureInPictureMode) {

View File

@ -4,4 +4,6 @@ interface OnlinePlayerOptions {
fun onCaptionsClicked()
fun onQualityClicked()
fun onAudioStreamClicked()
}

View File

@ -195,6 +195,14 @@ internal class CustomExoPlayerView(
playerOptionsInterface?.onQualityClicked()
}
)
items.add(
BottomSheetItem(
context.getString(R.string.audio_track),
R.drawable.ic_audio,
) {
playerOptionsInterface?.onAudioStreamClicked()
}
)
items.add(
BottomSheetItem(
context.getString(R.string.captions),

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z" />
</vector>

View File

@ -370,6 +370,7 @@
<string name="layout">Layout</string>
<string name="alternative_player_layout">Alternative player layout</string>
<string name="alternative_player_layout_summary">Show the related videos as a row above the comments instead of below.</string>
<string name="audio_track">Audio track</string>
<!-- Notification channel strings -->
<string name="download_channel_name">Download Service</string>