mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Add audio and video track support
This commit is contained in:
parent
67addd79a0
commit
ec3cdb60f2
8 changed files with 822 additions and 458 deletions
|
@ -212,6 +212,30 @@ class CS3IPlayer : IPlayer {
|
|||
|
||||
var currentSubtitles: SubtitleData? = null
|
||||
|
||||
override fun setExoplayerVideoSize(width: Int, height: Int) {
|
||||
exoPlayer?.trackSelectionParameters = exoPlayer?.trackSelectionParameters
|
||||
?.buildUpon()
|
||||
?.setMaxVideoSize(width, height)
|
||||
?.build()
|
||||
?: return
|
||||
}
|
||||
|
||||
override fun setExoplayerAudioTrack(trackLanguage: String?) {
|
||||
exoPlayer?.trackSelectionParameters = exoPlayer?.trackSelectionParameters
|
||||
?.buildUpon()
|
||||
?.setPreferredAudioLanguage(trackLanguage)
|
||||
?.build()
|
||||
?: return
|
||||
}
|
||||
|
||||
override fun getExoplayerTracks(): ExoplayerTracks {
|
||||
return ExoplayerTracks(
|
||||
exoPlayer?.videoFormat,
|
||||
exoPlayer?.audioFormat,
|
||||
exoPlayer?.currentTracksInfo?.trackGroupInfos ?: emptyList()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if the player should be reloaded
|
||||
* */
|
||||
|
@ -465,6 +489,7 @@ class CS3IPlayer : IPlayer {
|
|||
trackSelector.parameters = DefaultTrackSelector.ParametersBuilder(context)
|
||||
// .setRendererDisabled(C.TRACK_TYPE_VIDEO, true)
|
||||
.setRendererDisabled(C.TRACK_TYPE_TEXT, true)
|
||||
.setTunnelingEnabled(true)
|
||||
.setDisabledTextTrackSelectionFlags(C.TRACK_TYPE_TEXT)
|
||||
.clearSelectionOverrides()
|
||||
.build()
|
||||
|
|
|
@ -176,6 +176,10 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
|||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
open fun showTracksDialogue() {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
open fun openOnlineSubPicker(
|
||||
context: Context,
|
||||
imdbId: Long?,
|
||||
|
@ -1101,6 +1105,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
|||
|
||||
// if nothing has loaded these buttons should not be visible
|
||||
player_skip_episode?.isVisible = false
|
||||
player_tracks_btt?.isVisible = false
|
||||
player_skip_op?.isVisible = false
|
||||
shadow_overlay?.isVisible = false
|
||||
|
||||
|
@ -1296,6 +1301,10 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
|||
showMirrorsDialogue()
|
||||
}
|
||||
|
||||
player_tracks_btt?.setOnClickListener {
|
||||
showTracksDialogue()
|
||||
}
|
||||
|
||||
player_intro_play?.setOnClickListener {
|
||||
player_intro_play?.isGone = true
|
||||
player.handleEvent(CSPlayerEvent.Play)
|
||||
|
|
|
@ -18,6 +18,11 @@ import androidx.core.view.isGone
|
|||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.google.android.exoplayer2.C.TRACK_TYPE_AUDIO
|
||||
import com.google.android.exoplayer2.C.TRACK_TYPE_VIDEO
|
||||
import com.google.android.exoplayer2.Format
|
||||
import com.google.android.exoplayer2.Format.NO_VALUE
|
||||
import com.google.android.exoplayer2.TracksInfo
|
||||
import com.google.android.exoplayer2.util.MimeTypes
|
||||
import com.hippo.unifile.UniFile
|
||||
import com.lagradost.cloudstream3.*
|
||||
|
@ -53,6 +58,8 @@ import kotlinx.android.synthetic.main.dialog_online_subtitles.cancel_btt
|
|||
import kotlinx.android.synthetic.main.fragment_player.*
|
||||
import kotlinx.android.synthetic.main.player_custom_layout.*
|
||||
import kotlinx.android.synthetic.main.player_select_source_and_subs.*
|
||||
import kotlinx.android.synthetic.main.player_select_source_and_subs.subtitles_click_settings
|
||||
import kotlinx.android.synthetic.main.player_select_tracks.*
|
||||
import kotlinx.coroutines.Job
|
||||
|
||||
class GeneratorPlayer : FullScreenPlayer() {
|
||||
|
@ -106,6 +113,12 @@ class GeneratorPlayer : FullScreenPlayer() {
|
|||
|
||||
override fun embeddedSubtitlesFetched(subtitles: List<SubtitleData>) {
|
||||
viewModel.addSubtitles(subtitles.toSet())
|
||||
|
||||
val tracks = player.getExoplayerTracks().allTracks
|
||||
val videoTracks = tracks.filter { it.trackType == TRACK_TYPE_VIDEO }.getFormats().size
|
||||
val audioTracks = tracks.filter { it.trackType == TRACK_TYPE_AUDIO }.getFormats().size
|
||||
|
||||
player_tracks_btt?.isVisible = videoTracks > 1 || audioTracks > 1
|
||||
}
|
||||
|
||||
private fun noSubtitles(): Boolean {
|
||||
|
@ -476,6 +489,8 @@ class GeneratorPlayer : FullScreenPlayer() {
|
|||
}
|
||||
|
||||
var selectSourceDialog: AlertDialog? = null
|
||||
// var selectTracksDialog: AlertDialog? = null
|
||||
|
||||
override fun showMirrorsDialogue() {
|
||||
try {
|
||||
currentSelectedSubtitles = player.getCurrentPreferredSubtitle()
|
||||
|
@ -667,6 +682,139 @@ class GeneratorPlayer : FullScreenPlayer() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all supported formats in a list
|
||||
* */
|
||||
private fun List<TracksInfo.TrackGroupInfo>.getFormats(): List<Format> {
|
||||
return this.map {
|
||||
(0 until it.trackGroup.length).mapNotNull { i ->
|
||||
if (it.isSupported)
|
||||
it.trackGroup.getFormat(i) // to it.isSelected
|
||||
else null
|
||||
}
|
||||
}.flatten()
|
||||
}
|
||||
|
||||
override fun showTracksDialogue() {
|
||||
try {
|
||||
//println("CURRENT SELECTED :$currentSelectedSubtitles of $currentSubs")
|
||||
context?.let { ctx ->
|
||||
val tracks = player.getExoplayerTracks()
|
||||
|
||||
val isPlaying = player.getIsPlaying()
|
||||
player.handleEvent(CSPlayerEvent.Pause)
|
||||
|
||||
val currentVideoTracks = tracks.allTracks.filter {
|
||||
it.trackType == TRACK_TYPE_VIDEO
|
||||
}.getFormats().sortedBy {
|
||||
-it.height
|
||||
}
|
||||
|
||||
val currentAudioTracks = tracks.allTracks.filter {
|
||||
it.trackType == TRACK_TYPE_AUDIO
|
||||
}.getFormats()
|
||||
|
||||
val trackBuilder = AlertDialog.Builder(ctx, R.style.AlertDialogCustomBlack)
|
||||
.setView(R.layout.player_select_tracks)
|
||||
|
||||
val tracksDialog = trackBuilder.create()
|
||||
|
||||
// selectTracksDialog = tracksDialog
|
||||
|
||||
tracksDialog.show()
|
||||
val videosList = tracksDialog.video_tracks_list
|
||||
val audioList = tracksDialog.auto_tracks_list
|
||||
|
||||
tracksDialog.video_tracks_holder.isVisible = currentVideoTracks.size > 1
|
||||
tracksDialog.audio_tracks_holder.isVisible = currentAudioTracks.size > 1
|
||||
|
||||
fun dismiss() {
|
||||
if (isPlaying) {
|
||||
player.handleEvent(CSPlayerEvent.Play)
|
||||
}
|
||||
activity?.hideSystemUI()
|
||||
}
|
||||
|
||||
val videosArrayAdapter =
|
||||
ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice)
|
||||
|
||||
videosArrayAdapter.addAll(currentVideoTracks.mapIndexed { index, format ->
|
||||
format.label
|
||||
?: (if (format.height == NO_VALUE || format.width == NO_VALUE) index else "${format.width}x${format.height}").toString()
|
||||
})
|
||||
|
||||
videosList.choiceMode = AbsListView.CHOICE_MODE_SINGLE
|
||||
videosList.adapter = videosArrayAdapter
|
||||
|
||||
// Sometimes the data is not the same because some data gets resolved at different stages i think
|
||||
var videoIndex = currentVideoTracks.indexOf(tracks.currentVideoFormat).takeIf {
|
||||
it != -1
|
||||
} ?: currentVideoTracks.indexOfFirst {
|
||||
tracks.currentVideoFormat?.id == it.id
|
||||
}
|
||||
|
||||
videosList.setSelection(videoIndex)
|
||||
videosList.setItemChecked(videoIndex, true)
|
||||
|
||||
videosList.setOnItemClickListener { _, _, which, _ ->
|
||||
videoIndex = which
|
||||
videosList.setItemChecked(which, true)
|
||||
}
|
||||
|
||||
tracksDialog.setOnDismissListener {
|
||||
dismiss()
|
||||
// selectTracksDialog = null
|
||||
}
|
||||
|
||||
var audioIndexStart = currentAudioTracks.indexOf(tracks.currentAudioFormat).takeIf {
|
||||
it != -1
|
||||
} ?: currentVideoTracks.indexOfFirst {
|
||||
tracks.currentAudioFormat?.id == it.id
|
||||
}
|
||||
|
||||
val audioArrayAdapter =
|
||||
ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice)
|
||||
// audioArrayAdapter.add(ctx.getString(R.string.no_subtitles))
|
||||
audioArrayAdapter.addAll(currentAudioTracks.mapIndexed { index, format ->
|
||||
format.label ?: format.language?.let { fromTwoLettersToLanguage(it) } ?: index.toString()
|
||||
})
|
||||
|
||||
audioList.adapter = audioArrayAdapter
|
||||
audioList.choiceMode = AbsListView.CHOICE_MODE_SINGLE
|
||||
|
||||
audioList.setSelection(audioIndexStart)
|
||||
audioList.setItemChecked(audioIndexStart, true)
|
||||
|
||||
audioList.setOnItemClickListener { _, _, which, _ ->
|
||||
audioIndexStart = which
|
||||
audioList.setItemChecked(which, true)
|
||||
}
|
||||
|
||||
tracksDialog.cancel_btt?.setOnClickListener {
|
||||
tracksDialog.dismissSafe(activity)
|
||||
}
|
||||
|
||||
tracksDialog.apply_btt?.setOnClickListener {
|
||||
player.setExoplayerAudioTrack(
|
||||
currentAudioTracks.getOrNull(audioIndexStart)?.language
|
||||
)
|
||||
|
||||
val currentVideo = currentVideoTracks.getOrNull(videoIndex)
|
||||
val width = currentVideo?.width ?: NO_VALUE
|
||||
val height = currentVideo?.height ?: NO_VALUE
|
||||
if (width != NO_VALUE && height != NO_VALUE) {
|
||||
player.setExoplayerVideoSize(width, height)
|
||||
}
|
||||
|
||||
tracksDialog.dismissSafe(activity)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
logError(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun playerError(exception: Exception) {
|
||||
Log.i(TAG, "playerError = $currentSelectedLink")
|
||||
super.playerError(exception)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.lagradost.cloudstream3.ui.player
|
||||
|
||||
import android.content.Context
|
||||
import com.google.android.exoplayer2.Format
|
||||
import com.google.android.exoplayer2.TracksInfo
|
||||
import com.lagradost.cloudstream3.ui.subtitles.SaveCaptionStyle
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.ExtractorUri
|
||||
|
@ -46,6 +48,12 @@ enum class CSPlayerLoading {
|
|||
//IsDone,
|
||||
}
|
||||
|
||||
data class ExoplayerTracks(
|
||||
val currentVideoFormat: Format?,
|
||||
val currentAudioFormat: Format?,
|
||||
val allTracks: List<TracksInfo.TrackGroupInfo>
|
||||
)
|
||||
|
||||
class InvalidFileException(msg: String) : Exception(msg)
|
||||
|
||||
//http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
|
||||
|
@ -89,6 +97,7 @@ interface IPlayer {
|
|||
subtitlesUpdates: (() -> Unit)? = null, // callback from player to inform that subtitles have updated in some way
|
||||
embeddedSubtitlesFetched: ((List<SubtitleData>) -> Unit)? = null, // callback from player to give all embedded subtitles
|
||||
)
|
||||
|
||||
fun releaseCallbacks()
|
||||
|
||||
fun updateSubtitleStyle(style: SaveCaptionStyle)
|
||||
|
@ -121,4 +130,12 @@ interface IPlayer {
|
|||
|
||||
/** Get if player is actually used */
|
||||
fun isActive(): Boolean
|
||||
|
||||
fun getExoplayerTracks(): ExoplayerTracks
|
||||
|
||||
/** If no parameters are set it'll default to no set size */
|
||||
fun setExoplayerVideoSize(width: Int = Int.MAX_VALUE, height: Int = Int.MAX_VALUE)
|
||||
|
||||
/** If no trackLanguage is set it'll default to first track */
|
||||
fun setExoplayerAudioTrack(trackLanguage: String?)
|
||||
}
|
|
@ -75,6 +75,8 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
|
|||
}
|
||||
|
||||
override fun showMirrorsDialogue() {}
|
||||
override fun showTracksDialogue() {}
|
||||
|
||||
override fun openOnlineSubPicker(context: Context, imdbId: Long?, dismissCallback: () -> Unit) {}
|
||||
|
||||
override fun subtitlesChanged() {}
|
||||
|
|
|
@ -75,15 +75,15 @@
|
|||
|
||||
<FrameLayout
|
||||
android:id="@+id/player_episode_filler_holder"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_margin="20dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/player_episode_filler"
|
||||
style="@style/SmallBlackButton"
|
||||
android:text="@string/filler"
|
||||
android:id="@+id/player_episode_filler" />
|
||||
android:text="@string/filler" />
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
@ -149,9 +149,9 @@
|
|||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/go_back_img_des"
|
||||
android:src="@drawable/ic_baseline_arrow_back_24"
|
||||
app:tint="@android:color/white"
|
||||
android:contentDescription="@string/go_back_img_des" />
|
||||
app:tint="@android:color/white" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/player_go_back"
|
||||
|
@ -160,8 +160,8 @@
|
|||
android:layout_gravity="center"
|
||||
android:background="@drawable/video_tap_button_always_white"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/go_back_img_des" />
|
||||
android:contentDescription="@string/go_back_img_des"
|
||||
android:focusable="true" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
|
@ -169,54 +169,54 @@
|
|||
|
||||
<!--use for thinner app:trackThickness="3dp" com.google.android.material.progressindicator.CircularProgressIndicator-->
|
||||
<ProgressBar
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:id="@+id/player_buffering"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:id="@+id/player_buffering"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content" />
|
||||
|
||||
<!-- This nested layout is necessary because of buffering and clicking-->
|
||||
<FrameLayout
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- This nested layout is necessary because of buffering and clicking-->
|
||||
<FrameLayout
|
||||
android:id="@+id/player_pause_play_holder_holder"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:id="@+id/player_pause_play_holder_holder">
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
tools:ignore="uselessParent"
|
||||
android:id="@+id/player_pause_play_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="uselessParent">
|
||||
|
||||
<ImageView
|
||||
app:tint="@color/white"
|
||||
android:id="@+id/player_pause_play"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/video_tap_button"
|
||||
android:nextFocusLeft="@id/exo_rew"
|
||||
|
||||
android:nextFocusRight="@id/exo_ffwd"
|
||||
|
||||
android:nextFocusUp="@id/player_go_back"
|
||||
android:nextFocusDown="@id/player_lock"
|
||||
|
||||
android:layout_gravity="center"
|
||||
|
||||
android:src="@drawable/netflix_pause"
|
||||
android:background="@drawable/video_tap_button"
|
||||
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="ContentDescription" />
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
@ -227,8 +227,8 @@
|
|||
android:layout_height="100dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layoutDirection="ltr"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
@ -238,12 +238,12 @@
|
|||
android:id="@+id/player_rew_holder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintWidth_percent="0.5"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/player_ffwd_holder"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.5">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exo_rew_text"
|
||||
|
@ -272,21 +272,21 @@
|
|||
android:scaleType="fitCenter"
|
||||
android:scaleX="-1"
|
||||
android:src="@drawable/netflix_skip_forward"
|
||||
app:tint="@color/white"
|
||||
android:tintMode="src_in"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="ContentDescription" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/player_ffwd_holder"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_percent="0.5"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/player_rew_holder"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.5">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exo_ffwd_text"
|
||||
|
@ -312,8 +312,8 @@
|
|||
android:padding="10dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/netflix_skip_forward"
|
||||
app:tint="@color/white"
|
||||
android:tintMode="src_in"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="ContentDescription" />
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -333,48 +333,48 @@
|
|||
<ImageButton
|
||||
android:id="@id/exo_prev"
|
||||
style="@style/ExoMediaButton.Previous"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
android:tintMode="src_in"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_repeat_toggle"
|
||||
style="@style/ExoMediaButton"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
android:tintMode="src_in"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_next"
|
||||
style="@style/ExoMediaButton.Next"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
android:tintMode="src_in"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_vr"
|
||||
style="@style/ExoMediaButton.VR"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
android:tintMode="src_in"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_play"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
android:tintMode="src_in"
|
||||
tools:ignore="ContentDescription"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="0dp" />
|
||||
android:tintMode="src_in"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_pause"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
android:tintMode="src_in"
|
||||
tools:ignore="ContentDescription"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="0dp" />
|
||||
android:tintMode="src_in"
|
||||
app:tint="?attr/colorPrimaryDark"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -489,25 +489,37 @@
|
|||
tools:text="Speed" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:id="@+id/player_subtitle_offset_btt"
|
||||
style="@style/VideoButton"
|
||||
android:nextFocusLeft="@id/player_speed_btt"
|
||||
|
||||
android:nextFocusRight="@id/player_sources_btt"
|
||||
android:text="@string/subtitle_offset"
|
||||
|
||||
android:visibility="gone"
|
||||
app:icon="@drawable/ic_outline_subtitles_24"
|
||||
android:text="@string/subtitle_offset" />
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/player_sources_btt"
|
||||
style="@style/VideoButton"
|
||||
android:nextFocusLeft="@id/player_subtitle_offset_btt"
|
||||
android:layout_height="40dp"
|
||||
|
||||
android:nextFocusRight="@id/player_skip_op"
|
||||
android:nextFocusLeft="@id/player_subtitle_offset_btt"
|
||||
android:nextFocusRight="@id/player_tracks_btt"
|
||||
android:text="@string/video_source"
|
||||
app:icon="@drawable/ic_baseline_playlist_play_24" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/player_tracks_btt"
|
||||
style="@style/VideoButton"
|
||||
android:layout_height="40dp"
|
||||
|
||||
android:nextFocusLeft="@id/player_sources_btt"
|
||||
android:nextFocusRight="@id/player_skip_op"
|
||||
android:text="@string/tracks"
|
||||
app:icon="@drawable/ic_baseline_playlist_play_24" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/player_skip_op"
|
||||
style="@style/VideoButton"
|
||||
|
@ -568,14 +580,14 @@
|
|||
style="@android:style/Widget.Material.ProgressBar.Horizontal"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginStart="40dp"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
android:progress="100"
|
||||
android:progressDrawable="@drawable/progress_drawable_vertical"
|
||||
tools:progress="30"
|
||||
android:layout_centerInParent="true" />
|
||||
tools:progress="30" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -610,13 +622,13 @@
|
|||
style="@android:style/Widget.Material.ProgressBar.Horizontal"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
android:progress="100"
|
||||
android:progressDrawable="@drawable/progress_drawable_vertical"
|
||||
android:layout_centerInParent="true" />
|
||||
android:progressDrawable="@drawable/progress_drawable_vertical" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
148
app/src/main/res/layout/player_select_tracks.xml
Normal file
148
app/src/main/res/layout/player_select_tracks.xml
Normal file
|
@ -0,0 +1,148 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/video_tracks_holder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="50"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="@string/video_tracks"
|
||||
android:textColor="?attr/textColor"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ListView
|
||||
android:requiresFadingEdge="vertical"
|
||||
android:id="@+id/video_tracks_list"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
android:layout_height="match_parent"
|
||||
android:layout_rowWeight="1"
|
||||
android:background="?attr/primaryBlackBackground"
|
||||
android:nextFocusLeft="@id/sort_subtitles"
|
||||
android:nextFocusRight="@id/apply_btt"
|
||||
tools:listitem="@layout/sort_bottom_single_choice" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/audio_tracks_holder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="50"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- android:id="@+id/subs_settings" android:foreground="?android:attr/selectableItemBackgroundBorderless"
|
||||
-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<LinearLayout
|
||||
android:foreground="?attr/selectableItemBackgroundBorderless"
|
||||
android:id="@+id/subtitles_click_settings"
|
||||
android:layout_rowWeight="1"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:text="@string/audio_tracks"
|
||||
android:textColor="?attr/textColor"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:textSize="15sp"-->
|
||||
<!-- android:id="@+id/subtitles_encoding_format"-->
|
||||
<!-- android:textColor="?attr/textColor"-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- tools:text="Thai (TIS 620-2533/ISO 8859-11)"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content" />-->
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
|
||||
android:contentDescription="@string/home_change_provider_img_des"
|
||||
android:src="@drawable/ic_outline_settings_24"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:requiresFadingEdge="vertical"
|
||||
android:id="@+id/auto_tracks_list"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
android:layout_height="match_parent"
|
||||
android:layout_rowWeight="1"
|
||||
android:background="?attr/primaryBlackBackground"
|
||||
android:nextFocusLeft="@id/sort_providers"
|
||||
android:nextFocusRight="@id/cancel_btt"
|
||||
tools:listfooter="@layout/sort_bottom_footer_add_choice"
|
||||
tools:listitem="@layout/sort_bottom_single_choice" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/apply_btt_holder"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="bottom|end"
|
||||
android:layout_marginTop="-60dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp">
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/WhiteButton"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:text="@string/sort_apply"
|
||||
android:id="@+id/apply_btt"
|
||||
android:layout_width="wrap_content" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/BlackButton"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:text="@string/sort_cancel"
|
||||
android:id="@+id/cancel_btt"
|
||||
android:layout_width="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -607,4 +607,7 @@
|
|||
|
||||
<string name="download_all_plugins_from_repo">Download all plugins from this repository?</string>
|
||||
<string name="single_plugin_disabled" formatted="true">%s (Disabled)</string>
|
||||
<string name="tracks">Tracks</string>
|
||||
<string name="audio_tracks">Audio tracks</string>
|
||||
<string name="video_tracks">Video tracks</string>
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue