Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay

This commit is contained in:
Kelvin 2025-05-02 12:10:58 +02:00
commit 2baf53c5a4
7 changed files with 28 additions and 7 deletions

View file

@ -1,6 +1,7 @@
package com.futo.platformplayer.activities
import android.annotation.SuppressLint
import android.app.AlertDialog
import android.content.ComponentName
import android.content.Context
import android.content.Intent
@ -613,8 +614,18 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
UIDialogs.toast(this, "No external file permissions\nExporting and auto backups will not work");
}*/
private var _qrCodeLoadingDialog: AlertDialog? = null
fun showUrlQrCodeScanner() {
try {
_qrCodeLoadingDialog = UIDialogs.showDialog(this, R.drawable.ic_loader_animated, true,
"Launching QR scanner",
"Make sure your camera is enabled", null, -2,
UIDialogs.Action("Close", {
_qrCodeLoadingDialog?.dismiss()
_qrCodeLoadingDialog = null
}));
val integrator = IntentIntegrator(this)
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE)
integrator.setPrompt(getString(R.string.scan_a_qr_code))
@ -640,6 +651,9 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
super.onPause();
Logger.v(TAG, "onPause")
_isVisible = false;
_qrCodeLoadingDialog?.dismiss()
_qrCodeLoadingDialog = null
}
override fun onStop() {

View file

@ -176,7 +176,11 @@ class StateCasting {
fun stopDiscovering() {
_nsdManager?.apply {
_discoveryListeners.forEach {
stopServiceDiscovery(it.value)
try {
stopServiceDiscovery(it.value)
} catch (e: Throwable) {
//Ignored
}
}
}
}

View file

@ -460,10 +460,10 @@ class StateSync {
Log.i(TAG, "Started relay session.")
} catch (e: Throwable) {
Log.e(TAG, "Relay session failed.", e)
Thread.sleep(5000)
} finally {
_relaySession?.stop()
_relaySession = null
Thread.sleep(5000)
}
}
}.apply { start() }
@ -737,6 +737,9 @@ class StateSync {
val json = String(dataBody, Charsets.UTF_8);
val history = Serializer.json.decodeFromString<List<HistoryVideo>>(json);
Logger.i(TAG, "SyncHistory received ${history.size} videos from ${remotePublicKey}");
if (history.size == 1) {
Logger.i(TAG, "SyncHistory received update video '${history[0].video.name}' (url: ${history[0].video.url}) at timestamp ${history[0].position}");
}
var lastHistory = OffsetDateTime.MIN;
for(video in history){

View file

@ -218,7 +218,9 @@ class SyncSession : IAuthorizable {
sent = true
break
} catch (e: Throwable) {
Logger.w(TAG, "Packet failed to send (opcode = $opcode, subOpcode = $subOpcode)", e)
Logger.w(TAG, "Packet failed to send (opcode = $opcode, subOpcode = $subOpcode), closing channel", e)
channel.close()
removeChannel(channel)
}
}

View file

@ -40,8 +40,6 @@
android:id="@+id/radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp" />
</LinearLayout>

@ -1 +1 @@
Subproject commit edb526a9a0543517cd9e5e1fe0fe99673e173db2
Subproject commit ffdf4cda380e5e4e9e370412f014e704bd14c09e

@ -1 +1 @@
Subproject commit edb526a9a0543517cd9e5e1fe0fe99673e173db2
Subproject commit ffdf4cda380e5e4e9e370412f014e704bd14c09e