Compare commits

..

14 Commits

Author SHA1 Message Date
Kelvin K 44ff951ec6 Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay 2025-06-18 16:22:51 +02:00
Kelvin K 11319e0ec5 Refs 2025-06-18 16:22:28 +02:00
Koen J 100e98a960 Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay 2025-06-18 15:43:45 +02:00
Koen J c6100ede70 Added disable for hold playback rate increase. 2025-06-18 15:43:12 +02:00
Kelvin K a2986a72bd Refs 2025-06-18 14:43:20 +02:00
Kelvin K e0e90c5f74 submodules 2025-06-18 14:33:07 +02:00
Kelvin K 11992af81b Hide duration if unknown 2025-06-18 14:27:20 +02:00
Koen J 15d771f7fc Fixed channel loader not being animated. 2025-06-18 13:43:50 +02:00
Kelvin K 5ede474253 Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay 2025-06-18 12:41:43 +02:00
Kelvin K 7922aa6f80 Log on busy on main 2025-06-18 12:41:21 +02:00
Kelvin K 0c1333fa15 Downgrade v8, revert comments on diff thread 2025-06-18 12:40:25 +02:00
Koen J 53b9ba0368 Reverted changes. 2025-06-18 10:29:12 +02:00
Koen J c3a8877796 Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay 2025-06-18 10:07:29 +02:00
Koen J a464ae9df5 Added missing loader causing crash. 2025-06-18 10:07:02 +02:00
20 changed files with 84 additions and 35 deletions
+2 -2
View File
@@ -179,8 +179,8 @@ dependencies {
implementation 'com.google.code.gson:gson:2.10.1' //Used for complex/anonymous cases like during development conversions (eg. V8RemoteObject)
//JS
//implementation("com.caoccao.javet:javet-android:3.0.2")
implementation 'com.caoccao.javet:javet-v8-android:4.1.4'
implementation("com.caoccao.javet:javet-android:3.0.2")
//implementation 'com.caoccao.javet:javet-v8-android:4.1.4' //Change after extensive testing the freezing edge cases are solved.
//Exoplayer
implementation 'androidx.media3:media3-exoplayer:1.2.1'
@@ -98,16 +98,14 @@ inline fun <reified T> V8ValueArray.expectV8Variants(config: IV8PluginConfig, co
inline fun V8Plugin.ensureIsBusy() {
this.let {
if (!it.isThreadAlreadyBusy()) {
throw IllegalStateException("Tried to access V8Plugin without busy");
/*
//throw IllegalStateException("Tried to access V8Plugin without busy");
val stacktrace = Thread.currentThread().stackTrace;
Logger.w("Extensions_V8",
"V8 USE OUTSIDE BUSY: " + stacktrace.drop(3)?.firstOrNull().toString() +
", " + stacktrace.drop(4)?.firstOrNull().toString() +
", " + stacktrace.drop(5)?.firstOrNull()?.toString() +
", " + stacktrace.drop(6)?.firstOrNull()?.toString()
)
*/
);
}
}
}
@@ -118,7 +116,7 @@ inline fun V8Value.ensureIsBusy() {
}
inline fun <reified T> V8Value.expectV8Variant(config: IV8PluginConfig, contextName: String): T {
if(true)
if(false)
ensureIsBusy();
return when(T::class) {
String::class -> this.expectOrThrow<V8ValueString>(config, contextName).value as T;
@@ -587,18 +587,19 @@ class Settings : FragmentedStorageFileJson() {
@FormField(R.string.hold_playback_speed, FieldForm.DROPDOWN, R.string.hold_playback_speed_description, 27)
@DropdownFieldOptionsId(R.array.hold_playback_speeds)
var holdPlaybackSpeed: Int = 3;
var holdPlaybackSpeed: Int = 4;
fun getHoldPlaybackSpeed(): Double {
return when(holdPlaybackSpeed) {
0 -> 1.25
1 -> 1.5
2 -> 1.75
3 -> 2.0
4 -> 2.25
5 -> 2.5
6 -> 2.75
7 -> 3.0
0 -> 1.0
1 -> 1.25
2 -> 1.5
3 -> 1.75
4 -> 2.0
5 -> 2.25
6 -> 2.5
7 -> 2.75
8 -> 3.0
else -> 2.0
}
}
@@ -4,7 +4,6 @@ import android.content.Context
import com.caoccao.javet.exceptions.JavetCompilationException
import com.caoccao.javet.exceptions.JavetException
import com.caoccao.javet.exceptions.JavetExecutionException
import com.caoccao.javet.interfaces.IJavetEntityError
import com.caoccao.javet.interop.V8Host
import com.caoccao.javet.interop.V8Runtime
import com.caoccao.javet.values.V8Value
@@ -321,6 +320,37 @@ class V8Plugin {
throw ScriptCompilationException(config, "Compilation: [${context}]: ${scriptEx.message}\n(${scriptEx.scriptingError.lineNumber})[${scriptEx.scriptingError.startColumn}-${scriptEx.scriptingError.endColumn}]: ${scriptEx.scriptingError.sourceLine}", null, codeStripped);
}
catch(executeEx: JavetExecutionException) {
val obj = executeEx.scriptingError?.context
if(obj != null && obj.containsKey("plugin_type") == true) {
val pluginType = obj["plugin_type"].toString();
//Captcha
if (pluginType == "CaptchaRequiredException") {
throw ScriptCaptchaRequiredException(config,
obj["url"]?.toString(),
obj["body"]?.toString(),
executeEx, executeEx.scriptingError?.stack, codeStripped);
}
//Reload Required
if (pluginType == "ReloadRequiredException") {
throw ScriptReloadRequiredException(config,
obj["msg"]?.toString(),
obj["reloadData"]?.toString(),
executeEx, executeEx.scriptingError?.stack, codeStripped);
}
//Others
throwExceptionFromV8(
config,
pluginType,
(extractJSExceptionMessage(executeEx) ?: ""),
executeEx,
executeEx.scriptingError?.stack,
codeStripped
);
}
/* //Required for newer V8 versions
if(executeEx.scriptingError?.context is IJavetEntityError) {
val obj = executeEx.scriptingError?.context as IJavetEntityError
if(obj.context.containsKey("plugin_type") == true) {
@@ -354,6 +384,7 @@ class V8Plugin {
}
}
*/
throw ScriptExecutionException(config, extractJSExceptionMessage(executeEx) ?: "", null, executeEx.scriptingError?.stack, codeStripped);
}
catch(ex: Exception) {
@@ -172,7 +172,7 @@ class ChannelFragment : MainFragment() {
_buttonSubscribe = findViewById(R.id.button_subscribe)
_buttonSubscriptionSettings = findViewById(R.id.button_sub_settings)
_overlayLoading = findViewById(R.id.channel_loading_overlay)
_overlayLoadingSpinner = findViewById(R.id.channel_loader)
_overlayLoadingSpinner = findViewById(R.id.channel_loader_frag)
_overlayContainer = findViewById(R.id.overlay_container)
_buttonSubscribe.onSubscribed.subscribe {
UISlideOverlays.showSubscriptionOptionsOverlay(it, _overlayContainer)
@@ -958,7 +958,7 @@ class StatePlatform {
//Comments
fun getComments(content: IPlatformContentDetails): IPager<IPlatformComment> {
val client = getContentClient(content.url);
val pager = null;//content.getComments(client);
val pager = content.getComments(client);
return pager ?: getComments(content.url);
}
@@ -95,7 +95,13 @@ class VideoListEditorViewHolder : ViewHolder {
.into(_imageThumbnail);
_textName.text = v.name;
_textAuthor.text = v.author.name;
_textVideoDuration.text = v.duration.toHumanTime(false);
if(v.duration > 0) {
_textVideoDuration.text = v.duration.toHumanTime(false);
_textVideoDuration.visibility = View.VISIBLE;
}
else
_textVideoDuration.visibility = View.GONE;
val historyPosition = StateHistory.instance.getHistoryPosition(v.url)
_timeBar.progress = historyPosition.toFloat() / v.duration.toFloat();
@@ -204,8 +204,14 @@ open class PreviewVideoView : LinearLayout {
.into(_imageVideo);
};
if(!isPlanned)
_textVideoDuration.text = video.duration.toHumanTime(false);
if(!isPlanned) {
if(video.duration > 0) {
_textVideoDuration.text = video.duration.toHumanTime(false);
_textVideoDuration.visibility = View.VISIBLE;
}
else
_textVideoDuration.visibility = View.GONE;
}
else
_textVideoDuration.text = context.getString(R.string.planned);
@@ -240,7 +240,8 @@ class GestureControlView : LinearLayout {
&& !_adjustingFullscreenUp
&& !_adjustingFullscreenDown
&& !_isPanning
&& !_isZooming) {
&& !_isZooming
&& Settings.instance.playback.getHoldPlaybackSpeed() > 1.0) {
_speedHolding = true
showHoldSpeedControls()
onSpeedHoldStart.emit()
+1 -1
View File
@@ -173,7 +173,7 @@
android:background="#77000000"
android:gravity="center">
<ImageView
android:id="@+id/channel_loader"
android:id="@+id/channel_loader_frag"
android:layout_width="80dp"
android:layout_height="80dp"
app:srcCompat="@drawable/ic_loader_animated"
@@ -116,9 +116,9 @@
android:layout_marginBottom="6dp"
android:background="#DD000000"
android:visibility="gone"
android:gravity="center"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/container_locked"
@@ -118,7 +118,10 @@
android:layout_height="match_parent"
android:background="#BB000000"
android:visibility="gone"
android:orientation="vertical" />
android:gravity="center"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/container_locked"
@@ -107,8 +107,6 @@
android:textStyle="normal" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/container_loader"
android:layout_width="match_parent"
@@ -116,9 +114,13 @@
android:layout_marginBottom="6dp"
android:background="#DD000000"
android:visibility="gone"
android:gravity="center"
android:orientation="vertical">
<com.futo.platformplayer.views.LoaderView
android:id="@+id/loader"
android:layout_width="50dp"
android:layout_height="50dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/container_unavailable"
+1
View File
@@ -1112,6 +1112,7 @@
<item>5.0</item>
</string-array>
<string-array name="hold_playback_speeds">
<item>Disabled</item>
<item>1.25</item>
<item>1.5</item>
<item>1.75</item>