mirror of
https://gitlab.com/vyla-entertainment/TV.git
synced 2026-11-15 20:47:19 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
6e738c18d5
|
|||
|
2c094e254d
|
|||
|
97c45f14c2
|
|||
|
3d59612d6e
|
|||
|
bd7d443f21
|
|||
|
|
8cd9ec3671 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -8,4 +8,6 @@ android/.gradle/
|
||||
.env
|
||||
.build
|
||||
www/
|
||||
android/app/src/main/assets/
|
||||
android/app/src/main/assets/
|
||||
release/
|
||||
android/app/src/main/res/raw/*.crt
|
||||
@@ -11,7 +11,7 @@ android {
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 34
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
versionName "1.0.9"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
import tv.vyla.app.ui.components.VideoTintSampler
|
||||
import tv.vyla.app.ui.components.videoTint
|
||||
import android.util.Log
|
||||
|
||||
enum class ActivePlayerMenu {
|
||||
NONE, QUALITY, SUBTITLES, VOLUME, SETTINGS, MORE
|
||||
@@ -151,6 +152,7 @@ fun PlayerScreen(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun showControlsAndFocusPlay() {
|
||||
areControlsVisible = true
|
||||
resetHideTimer()
|
||||
@@ -161,6 +163,7 @@ fun PlayerScreen(
|
||||
} catch (_: Exception) {}
|
||||
}
|
||||
}
|
||||
|
||||
val exoPlayer = remember {
|
||||
ExoPlayer.Builder(context).build().apply {
|
||||
playWhenReady = true
|
||||
@@ -171,6 +174,7 @@ fun PlayerScreen(
|
||||
durationMs = duration.coerceAtLeast(0L)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onIsPlayingChanged(playing: Boolean) {
|
||||
isPlaying = playing
|
||||
if (playing) {
|
||||
@@ -224,6 +228,37 @@ fun PlayerScreen(
|
||||
exoPlayer.play()
|
||||
resetHideTimer()
|
||||
}
|
||||
DisposableEffect(exoPlayer) {
|
||||
val errorListener = object : Player.Listener { // source auto-fallback
|
||||
override fun onPlayerError(error: androidx.media3.common.PlaybackException) {
|
||||
val currentIdx = resolvedStreams.indexOf(activeStream)
|
||||
if (currentIdx != -1 && currentIdx + 1 < resolvedStreams.size) {
|
||||
// android.widget.Toast.makeText(context, "Source failed. Trying next...", android.widget.Toast.LENGTH_SHORT).show()
|
||||
Log.e("vyla", "Source failed. Trying next...")
|
||||
|
||||
coroutineScope.launch {
|
||||
delay(1500) // follow rate limits
|
||||
val nextStream = resolvedStreams[currentIdx + 1]
|
||||
activeStream = nextStream
|
||||
playStream(nextStream.primaryUrl, nextStream.headers)
|
||||
}
|
||||
} else {
|
||||
isBuffering = false
|
||||
Log.e("vyla", "All Sources Failed")
|
||||
android.widget.Toast.makeText(
|
||||
context,
|
||||
"All available sources failed. Please disable any VPN or try again later",
|
||||
android.widget.Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
exoPlayer.addListener(errorListener)
|
||||
|
||||
onDispose {
|
||||
exoPlayer.removeListener(errorListener)
|
||||
}
|
||||
}
|
||||
suspend fun focusEpisodeCard() {
|
||||
var tries = 0
|
||||
while (tries < 15) {
|
||||
@@ -232,9 +267,11 @@ fun PlayerScreen(
|
||||
try {
|
||||
episodeFocusRequester.requestFocus()
|
||||
return
|
||||
} catch (_: Exception) {}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun loadSeasonEpisodes(seasonNum: Int, focusFirst: Boolean = false) {
|
||||
selectedSeasonNum = seasonNum
|
||||
coroutineScope.launch {
|
||||
@@ -300,7 +337,9 @@ fun PlayerScreen(
|
||||
onFirstPlayable = { stream ->
|
||||
coroutineScope.launch {
|
||||
activeStream = stream
|
||||
resolvedStreams.add(stream)
|
||||
if (!resolvedStreams.any { it.provider == stream.provider }) {
|
||||
resolvedStreams.add(stream)
|
||||
}
|
||||
playStream(stream.primaryUrl, stream.headers)
|
||||
}
|
||||
},
|
||||
@@ -337,26 +376,31 @@ fun PlayerScreen(
|
||||
}
|
||||
|
||||
BackHandler {
|
||||
when {
|
||||
activeMenu != ActivePlayerMenu.NONE -> {
|
||||
val closedMenu = activeMenu
|
||||
activeMenu = ActivePlayerMenu.NONE
|
||||
areControlsVisible = true
|
||||
resetHideTimer()
|
||||
coroutineScope.launch {
|
||||
delay(50)
|
||||
try {
|
||||
when (closedMenu) {
|
||||
ActivePlayerMenu.QUALITY -> qualityButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.SUBTITLES -> ccButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.VOLUME -> volButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.SETTINGS -> setButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.MORE -> moreButtonFocusRequester.requestFocus()
|
||||
else -> playPauseFocusRequester.requestFocus()
|
||||
}
|
||||
} catch (_: Exception) {}
|
||||
fun closeActiveMenu() {
|
||||
val closedMenu = activeMenu
|
||||
activeMenu = ActivePlayerMenu.NONE
|
||||
areControlsVisible = true
|
||||
resetHideTimer()
|
||||
coroutineScope.launch {
|
||||
delay(50)
|
||||
try {
|
||||
when (closedMenu) {
|
||||
ActivePlayerMenu.QUALITY -> qualityButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.SUBTITLES -> ccButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.VOLUME -> volButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.SETTINGS -> setButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.MORE -> moreButtonFocusRequester.requestFocus()
|
||||
else -> playPauseFocusRequester.requestFocus()
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
when {
|
||||
activeMenu != ActivePlayerMenu.NONE -> {
|
||||
closeActiveMenu()
|
||||
}
|
||||
|
||||
isEpisodesDrawerOpen -> {
|
||||
isEpisodesDrawerOpen = false
|
||||
areControlsVisible = true
|
||||
@@ -365,12 +409,20 @@ fun PlayerScreen(
|
||||
delay(50)
|
||||
try {
|
||||
episodesButtonFocusRequester.requestFocus()
|
||||
} catch (_: Exception) {}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
areControlsVisible -> {
|
||||
hideControlsJob?.cancel()
|
||||
areControlsVisible = false
|
||||
try {
|
||||
playerContainerFocusRequester.requestFocus()
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
else -> onBack()
|
||||
}
|
||||
}
|
||||
@@ -382,6 +434,7 @@ fun PlayerScreen(
|
||||
idx >= 0 && (idx + 1 < allEpisodes.size || seasons.any { it.seasonNumber > ep.seasonNumber })
|
||||
}
|
||||
}
|
||||
|
||||
fun playNextEpisode() {
|
||||
val ep = currentEpisode ?: return
|
||||
val idx = allEpisodes.indexOfFirst { it.episodeNumber == ep.episodeNumber }
|
||||
@@ -420,6 +473,25 @@ fun PlayerScreen(
|
||||
playerViewRef?.videoSurfaceView
|
||||
}
|
||||
|
||||
fun closeActiveMenu() {
|
||||
val closedMenu = activeMenu
|
||||
activeMenu = ActivePlayerMenu.NONE
|
||||
resetHideTimer()
|
||||
coroutineScope.launch {
|
||||
delay(50)
|
||||
try {
|
||||
when (closedMenu) {
|
||||
ActivePlayerMenu.QUALITY -> qualityButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.SUBTITLES -> ccButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.VOLUME -> volButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.SETTINGS -> setButtonFocusRequester.requestFocus()
|
||||
ActivePlayerMenu.MORE -> moreButtonFocusRequester.requestFocus()
|
||||
else -> playPauseFocusRequester.requestFocus()
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Box(
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
@@ -431,10 +503,14 @@ fun PlayerScreen(
|
||||
val code = event.nativeKeyEvent.keyCode
|
||||
|
||||
if (!areControlsVisible) {
|
||||
if (code == KeyEvent.KEYCODE_BACK || code == KeyEvent.KEYCODE_ESCAPE) { // defer to backhandler
|
||||
return@onKeyEvent false
|
||||
}
|
||||
val pendingSegment = activeSegment
|
||||
val isConfirm = code == KeyEvent.KEYCODE_DPAD_CENTER ||
|
||||
code == KeyEvent.KEYCODE_ENTER ||
|
||||
code == KeyEvent.KEYCODE_NUMPAD_ENTER
|
||||
|
||||
if (pendingSegment != null && isConfirm && activeMenu == ActivePlayerMenu.NONE && !isEpisodesDrawerOpen) {
|
||||
skipSegment(pendingSegment)
|
||||
return@onKeyEvent true
|
||||
@@ -446,41 +522,70 @@ fun PlayerScreen(
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
if (code == KeyEvent.KEYCODE_BACK || code == KeyEvent.KEYCODE_ESCAPE) {
|
||||
when {
|
||||
activeMenu != ActivePlayerMenu.NONE -> {
|
||||
return@onKeyEvent false // defer to backhandler
|
||||
}
|
||||
|
||||
isEpisodesDrawerOpen -> {
|
||||
return@onKeyEvent false // defer to backhandler
|
||||
}
|
||||
|
||||
else -> { // hide controls
|
||||
|
||||
hideControlsJob?.cancel()
|
||||
areControlsVisible = false
|
||||
try {
|
||||
playerContainerFocusRequester.requestFocus()
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
return@onKeyEvent true
|
||||
}
|
||||
}
|
||||
}
|
||||
when (code) {
|
||||
KeyEvent.KEYCODE_MEDIA_PLAY -> {
|
||||
exoPlayer.play()
|
||||
showControlsAndFocusPlay()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_MEDIA_PAUSE -> {
|
||||
exoPlayer.pause()
|
||||
showControlsAndFocusPlay()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> {
|
||||
if (exoPlayer.isPlaying) exoPlayer.pause() else exoPlayer.play()
|
||||
showControlsAndFocusPlay()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_MEDIA_FAST_FORWARD -> {
|
||||
exoPlayer.seekTo((exoPlayer.currentPosition + 10000).coerceAtMost(exoPlayer.duration))
|
||||
resetHideTimer()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_MEDIA_REWIND -> {
|
||||
exoPlayer.seekTo((exoPlayer.currentPosition - 10000).coerceAtLeast(0))
|
||||
resetHideTimer()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_SPACE -> {
|
||||
if (exoPlayer.isPlaying) exoPlayer.pause() else exoPlayer.play()
|
||||
showControlsAndFocusPlay()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_BACK -> {
|
||||
resetHideTimer()
|
||||
return@onKeyEvent false
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_CENTER -> {
|
||||
resetHideTimer()
|
||||
return@onKeyEvent false
|
||||
@@ -499,7 +604,8 @@ fun PlayerScreen(
|
||||
isFocusable = false
|
||||
isFocusableInTouchMode = false
|
||||
descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
||||
resizeMode = if (isFillScreen) AspectRatioFrameLayout.RESIZE_MODE_ZOOM else AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||
resizeMode =
|
||||
if (isFillScreen) AspectRatioFrameLayout.RESIZE_MODE_ZOOM else AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||
layoutParams = FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
@@ -520,7 +626,7 @@ fun PlayerScreen(
|
||||
}
|
||||
}
|
||||
val seg = activeSegment
|
||||
val showNextPrompt = isNextEpAvailable && durationMs > 0 && (durationMs - currentPositionMs) in 1..300000
|
||||
val showNextPrompt = isNextEpAvailable && durationMs > 0 && (durationMs - currentPositionMs) in 1..30000
|
||||
if ((seg != null || showNextPrompt) && activeMenu == ActivePlayerMenu.NONE && !isEpisodesDrawerOpen) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.End,
|
||||
@@ -751,7 +857,8 @@ fun PlayerScreen(
|
||||
onLeftPress = {
|
||||
try {
|
||||
seekbarFocusRequester.requestFocus()
|
||||
} catch (_: Exception) {}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
},
|
||||
onUpPress = {
|
||||
try {
|
||||
@@ -770,6 +877,7 @@ fun PlayerScreen(
|
||||
}
|
||||
}
|
||||
if (activeMenu != ActivePlayerMenu.NONE) {
|
||||
var menuHasFocus by remember { mutableStateOf(false) }
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.align(Alignment.TopEnd)
|
||||
@@ -781,6 +889,30 @@ fun PlayerScreen(
|
||||
.border(1.dp, Color(0x33FFFFFF), RoundedCornerShape(18.dp))
|
||||
.padding(14.dp)
|
||||
.zIndex(25f)
|
||||
.onFocusChanged { state ->
|
||||
if (menuHasFocus && !state.hasFocus) {
|
||||
// Focus navigated outside the menu popup: dismiss it
|
||||
activeMenu = ActivePlayerMenu.NONE
|
||||
resetHideTimer()
|
||||
}
|
||||
menuHasFocus = state.hasFocus
|
||||
}
|
||||
.onKeyEvent { event ->
|
||||
if (event.type == KeyEventType.KeyDown) {
|
||||
when (event.nativeKeyEvent.keyCode) {
|
||||
KeyEvent.KEYCODE_BACK, KeyEvent.KEYCODE_ESCAPE -> {
|
||||
closeActiveMenu()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_LEFT -> {
|
||||
closeActiveMenu()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
) {
|
||||
LazyColumn(modifier = Modifier.fillMaxWidth()) {
|
||||
when (activeMenu) {
|
||||
@@ -816,6 +948,7 @@ fun PlayerScreen(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ActivePlayerMenu.SUBTITLES -> {
|
||||
item {
|
||||
MenuSectionHeader("Subtitles")
|
||||
@@ -870,7 +1003,11 @@ fun PlayerScreen(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = Modifier.padding(horizontal = 6.dp, vertical = 4.dp)
|
||||
) {
|
||||
listOf("White" to "#FFFFFF", "Yellow" to "#FFD700", "Cyan" to "#00FFFF").forEach { (name, hex) ->
|
||||
listOf(
|
||||
"White" to "#FFFFFF",
|
||||
"Yellow" to "#FFD700",
|
||||
"Cyan" to "#00FFFF"
|
||||
).forEach { (name, hex) ->
|
||||
MiniSelectButton(
|
||||
text = name,
|
||||
isSelected = subtitleColorHex == hex,
|
||||
@@ -880,6 +1017,7 @@ fun PlayerScreen(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ActivePlayerMenu.VOLUME -> {
|
||||
item {
|
||||
MenuSectionHeader("Volume Control")
|
||||
@@ -931,14 +1069,16 @@ fun PlayerScreen(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
ActivePlayerMenu.SETTINGS -> {
|
||||
item {
|
||||
MenuSectionHeader("Available Sources (${resolvedStreams.size})")
|
||||
}
|
||||
items(resolvedStreams) { stream ->
|
||||
itemsIndexed(resolvedStreams) { index, stream ->
|
||||
MenuItemRow(
|
||||
label = stream.label,
|
||||
isSelected = activeStream?.provider == stream.provider,
|
||||
isSelected = ((activeStream?.provider == stream.provider) && (activeStream?.primaryUrl == stream.primaryUrl)),
|
||||
focusRequester = if (index == 0) menuFirstItemFocusRequester else null,
|
||||
onClick = {
|
||||
activeStream = stream
|
||||
playStream(stream.primaryUrl, stream.headers)
|
||||
@@ -984,6 +1124,7 @@ fun PlayerScreen(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
ActivePlayerMenu.MORE -> {
|
||||
item {
|
||||
MenuSectionHeader("Library")
|
||||
@@ -1008,6 +1149,7 @@ fun PlayerScreen(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
@@ -1074,7 +1216,8 @@ fun PlayerScreen(
|
||||
delay(50)
|
||||
try {
|
||||
episodesButtonFocusRequester.requestFocus()
|
||||
} catch (_: Exception) {}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -1105,6 +1248,7 @@ fun PlayerScreen(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PlayerCircleButton(
|
||||
icon: androidx.compose.ui.graphics.vector.ImageVector,
|
||||
@@ -1125,6 +1269,8 @@ private fun PlayerCircleButton(
|
||||
.videoTint(isFocused, isSelected)
|
||||
.then(if (focusRequester != null) Modifier.focusRequester(focusRequester) else Modifier)
|
||||
.onFocusChanged { isFocused = it.isFocused }
|
||||
.focusable()
|
||||
.videoTint(isFocused, isSelected)
|
||||
.onKeyEvent { event ->
|
||||
if (event.type == KeyEventType.KeyDown && event.nativeKeyEvent.keyCode == KeyEvent.KEYCODE_DPAD_DOWN && onDownPress != null) {
|
||||
onDownPress()
|
||||
@@ -1132,7 +1278,6 @@ private fun PlayerCircleButton(
|
||||
}
|
||||
false
|
||||
}
|
||||
.focusable()
|
||||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = null
|
||||
@@ -1146,6 +1291,7 @@ private fun PlayerCircleButton(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PlayerEpisodesButton(
|
||||
focusRequester: FocusRequester,
|
||||
@@ -1171,6 +1317,7 @@ private fun PlayerEpisodesButton(
|
||||
onLeftPress()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_UP -> {
|
||||
onUpPress()
|
||||
return@onKeyEvent true
|
||||
@@ -1193,6 +1340,7 @@ private fun PlayerEpisodesButton(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PlayerCenterPlayButton(
|
||||
isPlaying: Boolean,
|
||||
@@ -1232,6 +1380,7 @@ private fun PlayerCenterPlayButton(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PlayerPillButton(
|
||||
text: String,
|
||||
@@ -1279,6 +1428,7 @@ private fun PlayerPillButton(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PlayerSeekBar(
|
||||
currentPositionMs: Long,
|
||||
@@ -1297,7 +1447,10 @@ private fun PlayerSeekBar(
|
||||
if (!isFocused) isScrubbingMode = false
|
||||
}
|
||||
val barHeight by animateDpAsState(if (isFocused || isScrubbingMode) 6.dp else 4.dp, label = "bar_height")
|
||||
val thumbScale by animateFloatAsState(if (isScrubbingMode) 1.5f else if (isFocused) 1.3f else 1.0f, label = "thumb_scale")
|
||||
val thumbScale by animateFloatAsState(
|
||||
if (isScrubbingMode) 1.5f else if (isFocused) 1.3f else 1.0f,
|
||||
label = "thumb_scale"
|
||||
)
|
||||
val progressFraction = if (durationMs > 0) (currentPositionMs.toFloat() / durationMs).coerceIn(0f, 1f) else 0f
|
||||
val bufferFraction = if (durationMs > 0) (bufferedPositionMs.toFloat() / durationMs).coerceIn(0f, 1f) else 0f
|
||||
Box(
|
||||
@@ -1313,12 +1466,14 @@ private fun PlayerSeekBar(
|
||||
onUpPress()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_DOWN -> {
|
||||
if (onRequestEpisodesFocus != null) {
|
||||
onRequestEpisodesFocus()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_RIGHT -> {
|
||||
if (isScrubbingMode) {
|
||||
onSeekRight()
|
||||
@@ -1333,10 +1488,12 @@ private fun PlayerSeekBar(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_LEFT -> {
|
||||
onSeekLeft()
|
||||
return@onKeyEvent true
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_CENTER, KeyEvent.KEYCODE_ENTER -> {
|
||||
isScrubbingMode = !isScrubbingMode
|
||||
return@onKeyEvent true
|
||||
@@ -1404,6 +1561,7 @@ private fun PlayerSeekBar(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun MenuSectionHeader(title: String) {
|
||||
Text(
|
||||
@@ -1415,6 +1573,7 @@ private fun MenuSectionHeader(title: String) {
|
||||
modifier = Modifier.padding(start = 12.dp, end = 12.dp, top = 12.dp, bottom = 6.dp)
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun MenuItemRow(
|
||||
label: String,
|
||||
@@ -1459,6 +1618,7 @@ private fun MenuItemRow(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun MiniSelectButton(
|
||||
text: String,
|
||||
@@ -1493,6 +1653,7 @@ private fun MiniSelectButton(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DrawerEpisodeCard(
|
||||
episode: Episode,
|
||||
@@ -1599,6 +1760,7 @@ private fun DrawerEpisodeCard(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SeasonSelectChip(
|
||||
season: Season,
|
||||
@@ -1628,6 +1790,7 @@ private fun SeasonSelectChip(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun formatTime(ms: Long): String {
|
||||
val totalSeconds = (ms / 1000).coerceAtLeast(0)
|
||||
val hours = totalSeconds / 3600
|
||||
|
||||
0
android/gradlew
vendored
Normal file → Executable file
0
android/gradlew
vendored
Normal file → Executable file
903
package-lock.json
generated
903
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tv",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"description": "",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -9,9 +9,9 @@
|
||||
"android": "node scripts/build-android.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vyla-entertainment/sdk": "^1.18.0",
|
||||
"@vyla-entertainment/sdk": "^1.29.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"express": "^4.19.2",
|
||||
"express": "^4.22.3",
|
||||
"hls.js": "^1.7.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -21,5 +21,9 @@
|
||||
"main": "server.js",
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
"license": "ISC",
|
||||
"allowScripts": {
|
||||
"esbuild@0.25.12": true,
|
||||
"koffi@2.16.4": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Vyla TV",
|
||||
"version": "1.0.6",
|
||||
"package": "Vyla-TV_1.0.6.apk",
|
||||
"releaseDate": "2026-10-06T03:41:56.445Z"
|
||||
}
|
||||
@@ -56,14 +56,52 @@ globalThis.VylaLocal = {
|
||||
`;
|
||||
fs.writeFileSync(path.join(tmp, 'entry.js'), entry);
|
||||
|
||||
const nodeStubPlugin = {
|
||||
name: 'node-stub',
|
||||
setup(build) {
|
||||
build.onResolve(
|
||||
{
|
||||
filter: /^(node:|fs(\/promises)?$|path$|crypto$|https$|http$|events$|os$|stream$|util$|url$|zlib$|net$|tls$|child_process$|worker_threads$|async_hooks$|perf_hooks$|readline$|koffi$|piscina$|node-tls-client$)/,
|
||||
},
|
||||
(args) => ({
|
||||
path: args.path,
|
||||
namespace: 'node-stub',
|
||||
})
|
||||
);
|
||||
|
||||
build.onLoad({ filter: /^node-tls-client$/, namespace: 'node-stub' }, () => ({
|
||||
contents: `
|
||||
export const ClientIdentifier = {};
|
||||
export const destroyTLS = async () => {};
|
||||
export const initTLS = async () => {};
|
||||
export class Session {
|
||||
async get() { throw new Error('node-tls-client not supported in webview'); }
|
||||
async post() { throw new Error('node-tls-client not supported on webview'); }
|
||||
async close() {}
|
||||
}
|
||||
export default { ClientIdentifier, destroyTLS, initTLS, Session };
|
||||
`,
|
||||
loader: 'js',
|
||||
}));
|
||||
|
||||
build.onLoad({ filter: /.*/, namespace: 'node-stub' }, () => ({
|
||||
contents: 'module.exports = {};',
|
||||
loader: 'js',
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
await build({
|
||||
entryPoints: [path.join(tmp, 'entry.js')],
|
||||
bundle: true,
|
||||
format: 'iife',
|
||||
target: 'chrome70',
|
||||
platform: 'browser',
|
||||
plugins: [nodeStubPlugin],
|
||||
minify: true,
|
||||
alias: { 'node:crypto': path.join(shim, 'crypto.js') },
|
||||
alias: {
|
||||
'node:crypto': path.join(shim, 'crypto.js')
|
||||
},
|
||||
inject: [path.join(shim, 'inject.js')],
|
||||
outfile: path.join(www, 'js/vyla-local.js'),
|
||||
logLevel: 'info'
|
||||
|
||||
1
scripts/empty-shim.js
Normal file
1
scripts/empty-shim.js
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
Reference in New Issue
Block a user