Compare commits
2 Commits
7eea5c9ca1
...
5713b6572e
Author | SHA1 | Date | |
---|---|---|---|
5713b6572e
|
|||
4381016e57
|
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
|
@@ -1,24 +0,0 @@
|
||||
package com.zefie.zkiosk
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.zefie.zkiosk", appContext.packageName)
|
||||
}
|
||||
}
|
@@ -51,8 +51,8 @@ class MainActivity : AppCompatActivity() {
|
||||
videoLayout1 = findViewById(R.id.videoLayout1)
|
||||
videoLayout2 = findViewById(R.id.videoLayout2)
|
||||
restartButton = findViewById(R.id.restartButton)
|
||||
vlcPlayer1 = VLCPlayer(this, videoLayout1)
|
||||
vlcPlayer2 = VLCPlayer(this, videoLayout2)
|
||||
vlcPlayer1 = VLCPlayer(this, videoLayout1, 1)
|
||||
vlcPlayer2 = VLCPlayer(this, videoLayout2, 2)
|
||||
val seekBar = findViewById<SeekBar>(R.id.durationSlider)
|
||||
setupSliderPopup(seekBar)
|
||||
|
||||
|
@@ -4,12 +4,13 @@ import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.widget.Toast
|
||||
import org.videolan.libvlc.LibVLC
|
||||
import org.videolan.libvlc.Media
|
||||
import org.videolan.libvlc.MediaPlayer
|
||||
import org.videolan.libvlc.util.VLCVideoLayout
|
||||
|
||||
class VLCPlayer(context: Context, private val videoLayout: VLCVideoLayout) {
|
||||
class VLCPlayer(private val context: Context, private val videoLayout: VLCVideoLayout, private val streamId: Int) {
|
||||
private val libVLC: LibVLC = LibVLC(context, arrayListOf("--rtsp-tcp",
|
||||
"--quiet",
|
||||
"--no-drop-late-frames",
|
||||
@@ -65,6 +66,9 @@ class VLCPlayer(context: Context, private val videoLayout: VLCVideoLayout) {
|
||||
if (stalled) {
|
||||
val freezeDuration = now - lastProgressCheck
|
||||
if (freezeDuration > 8000) {
|
||||
handler.post {
|
||||
Toast.makeText(context, "Watchdog triggered: Stream ${streamId} stalled, restarting...", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
restartStream()
|
||||
return
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
[versions]
|
||||
agp = "8.8.2"
|
||||
agp = "8.9.1"
|
||||
appcompat = "1.7.0"
|
||||
kotlin = "2.0.0"
|
||||
coreKtx = "1.15.0"
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Sun Mar 02 16:14:47 EST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
Reference in New Issue
Block a user