mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-21 07:15:21 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8491d4da1a | |||
| 9bea1563ca | |||
| 9e7b936663 | |||
| 19c84475db | |||
| 4164b1a3f8 | |||
| a9dc038190 | |||
| 2825db88a5 |
@@ -724,7 +724,7 @@ class VideoDownload {
|
||||
val t = cue.groupValues[1];
|
||||
val d = cue.groupValues[2];
|
||||
|
||||
val url = foundTemplateUrl.replace("\$Number\$", (indexCounter + 1).toString());
|
||||
val url = foundTemplateUrl.replace("\$Number\$", (indexCounter).toString());
|
||||
|
||||
val data = if(executor != null)
|
||||
executor.executeRequest("GET", url, null, mapOf());
|
||||
|
||||
+8
-7
@@ -174,6 +174,7 @@ import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.coroutines.withContext
|
||||
import userpackage.Protocol
|
||||
import java.time.OffsetDateTime
|
||||
import java.util.Locale
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.roundToLong
|
||||
|
||||
@@ -1484,7 +1485,7 @@ class VideoDetailView : ConstraintLayout {
|
||||
)
|
||||
}
|
||||
|
||||
if (me.video == video)
|
||||
if (me.video?.url == video.url && !video.url.isNullOrBlank())
|
||||
me._playbackTracker = tracker;
|
||||
} else if (me.video == video)
|
||||
me._playbackTracker = null;
|
||||
@@ -2192,19 +2193,19 @@ class VideoDetailView : ConstraintLayout {
|
||||
if (canSetSpeed) SlideUpMenuButtonList(this.context, null, "playback_rate").apply {
|
||||
val playbackSpeeds = Settings.instance.playback.getPlaybackSpeeds();
|
||||
val format = if(playbackSpeeds.size < 20) "%.2f" else "%.1f";
|
||||
val playbackLabels = playbackSpeeds.map { String.format(format, it) }.toMutableList();
|
||||
val playbackLabels = playbackSpeeds.map { String.format(Locale.US, format, it) }.toMutableList();
|
||||
playbackLabels.add("+");
|
||||
playbackLabels.add(0, "-");
|
||||
|
||||
setButtons(playbackLabels, String.format(format, currentPlaybackRate));
|
||||
setButtons(playbackLabels, String.format(Locale.US, format, currentPlaybackRate));
|
||||
onClick.subscribe { v ->
|
||||
val currentPlaybackSpeed = if (_isCasting) StateCasting.instance.activeDevice?.speed else _player.getPlaybackRate();
|
||||
var playbackSpeedString = v;
|
||||
val stepSpeed = Settings.instance.playback.getPlaybackSpeedStep();
|
||||
if(v == "+")
|
||||
playbackSpeedString = String.format("%.2f", Math.min((currentPlaybackSpeed?.toDouble() ?: 1.0) + stepSpeed, 5.0)).toString();
|
||||
playbackSpeedString = String.format(Locale.US, "%.2f", Math.min((currentPlaybackSpeed?.toDouble() ?: 1.0) + stepSpeed, 5.0)).toString();
|
||||
else if(v == "-")
|
||||
playbackSpeedString = String.format("%.2f", Math.max(0.1, (currentPlaybackSpeed?.toDouble() ?: 1.0) - stepSpeed)).toString();
|
||||
playbackSpeedString = String.format(Locale.US, "%.2f", Math.max(0.1, (currentPlaybackSpeed?.toDouble() ?: 1.0) - stepSpeed)).toString();
|
||||
val newPlaybackSpeed = playbackSpeedString.toDouble();
|
||||
if (_isCasting) {
|
||||
val ad = StateCasting.instance.activeDevice ?: return@subscribe
|
||||
@@ -2212,11 +2213,11 @@ class VideoDetailView : ConstraintLayout {
|
||||
return@subscribe
|
||||
}
|
||||
|
||||
qualityPlaybackSpeedTitle?.setTitle(context.getString(R.string.playback_rate) + " (${String.format("%.2f", newPlaybackSpeed)})");
|
||||
qualityPlaybackSpeedTitle?.setTitle(context.getString(R.string.playback_rate) + " (${String.format(Locale.US, "%.2f", newPlaybackSpeed)})");
|
||||
ad.changeSpeed(newPlaybackSpeed)
|
||||
setSelected(playbackSpeedString);
|
||||
} else {
|
||||
qualityPlaybackSpeedTitle?.setTitle(context.getString(R.string.playback_rate) + " (${String.format("%.2f", newPlaybackSpeed)})");
|
||||
qualityPlaybackSpeedTitle?.setTitle(context.getString(R.string.playback_rate) + " (${String.format(Locale.US, "%.2f", newPlaybackSpeed)})");
|
||||
_player.setPlaybackRate(playbackSpeedString.toFloat());
|
||||
setSelected(playbackSpeedString);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ class GestureControlView : LinearLayout {
|
||||
private var _surfaceView: View? = null
|
||||
private var _layoutIndicatorFill: FrameLayout;
|
||||
private var _layoutIndicatorFit: FrameLayout;
|
||||
private var _speedHolding = false
|
||||
|
||||
private val _gestureController: GestureDetectorCompat;
|
||||
|
||||
@@ -103,6 +104,8 @@ class GestureControlView : LinearLayout {
|
||||
val onZoom = Event1<Float>();
|
||||
val onSoundAdjusted = Event1<Float>();
|
||||
val onToggleFullscreen = Event0();
|
||||
val onSpeedHoldStart = Event0()
|
||||
val onSpeedHoldEnd = Event0()
|
||||
|
||||
var fullScreenGestureEnabled = true
|
||||
|
||||
@@ -216,7 +219,19 @@ class GestureControlView : LinearLayout {
|
||||
|
||||
return true;
|
||||
}
|
||||
override fun onLongPress(p0: MotionEvent) = Unit
|
||||
override fun onLongPress(p0: MotionEvent) {
|
||||
if (!_isControlsLocked
|
||||
&& !_skipping
|
||||
&& !_adjustingBrightness
|
||||
&& !_adjustingSound
|
||||
&& !_adjustingFullscreenUp
|
||||
&& !_adjustingFullscreenDown
|
||||
&& !_isPanning
|
||||
&& !_isZooming) {
|
||||
_speedHolding = true
|
||||
onSpeedHoldStart.emit()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
_gestureController.setOnDoubleTapListener(object : GestureDetector.OnDoubleTapListener {
|
||||
@@ -309,6 +324,11 @@ class GestureControlView : LinearLayout {
|
||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||
val ev = event ?: return super.onTouchEvent(event);
|
||||
|
||||
if (ev.action == MotionEvent.ACTION_UP && _speedHolding) {
|
||||
_speedHolding = false
|
||||
onSpeedHoldEnd.emit()
|
||||
}
|
||||
|
||||
cancelHideJob();
|
||||
|
||||
if (_skipping) {
|
||||
|
||||
@@ -117,6 +117,9 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
||||
|
||||
private var _isControlsLocked: Boolean = false;
|
||||
|
||||
private var _speedHoldPrevRate = 1f
|
||||
private var _speedHoldWasPlaying = false
|
||||
|
||||
private val _time_bar_listener: TimeBar.OnScrubListener;
|
||||
|
||||
var isFitMode : Boolean = false
|
||||
@@ -254,6 +257,20 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
||||
gestureControl = findViewById(R.id.gesture_control);
|
||||
|
||||
gestureControl.setupTouchArea(_layoutControls, background);
|
||||
gestureControl.onSpeedHoldStart.subscribe {
|
||||
exoPlayer?.player?.let { player ->
|
||||
_speedHoldWasPlaying = player.isPlaying
|
||||
_speedHoldPrevRate = getPlaybackRate()
|
||||
setPlaybackRate(2f)
|
||||
player.play()
|
||||
}
|
||||
}
|
||||
gestureControl.onSpeedHoldEnd.subscribe {
|
||||
exoPlayer?.player?.let { player ->
|
||||
if (!_speedHoldWasPlaying) player.pause()
|
||||
setPlaybackRate(_speedHoldPrevRate)
|
||||
}
|
||||
}
|
||||
gestureControl.onSeek.subscribe { seekFromCurrent(it); };
|
||||
gestureControl.onSoundAdjusted.subscribe {
|
||||
if (Settings.instance.gestureControls.useSystemVolume) {
|
||||
|
||||
Submodule app/src/stable/assets/sources/nebula updated: 97a5ad5a37...880da6a015
Submodule app/src/stable/assets/sources/rumble updated: 3bbce81794...401274b1ec
Submodule app/src/stable/assets/sources/spotify updated: 1d884f50ab...d025804364
Submodule app/src/stable/assets/sources/youtube updated: 6d6838e2a4...2e25829494
Submodule app/src/unstable/assets/sources/nebula updated: 97a5ad5a37...880da6a015
Submodule app/src/unstable/assets/sources/rumble updated: 3bbce81794...401274b1ec
Submodule app/src/unstable/assets/sources/spotify updated: 1d884f50ab...d025804364
Submodule app/src/unstable/assets/sources/youtube updated: 6d6838e2a4...2e25829494
Reference in New Issue
Block a user