File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
src/main/kotlin/uk/co/sentinelweb/cuer/hub/ui/player/vlc
shared/src/commonMain/kotlin/uk/co/sentinelweb/cuer/app Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ compose.desktop {
53
53
mainClass = " uk.co.sentinelweb.cuer.hub.main.MainKt"
54
54
nativeDistributions {
55
55
targetFormats(TargetFormat .Dmg , TargetFormat .Msi , TargetFormat .Deb )
56
- packageName = " Cuer Hub "
56
+ packageName = " Cuer"
57
57
packageVersion = " 1.0.0" // fixme should use app_versionName but there are a lot of platform dependent rules
58
58
}
59
59
}
Original file line number Diff line number Diff line change @@ -310,14 +310,16 @@ class VlcPlayerSwingWindow(
310
310
}
311
311
seekBar.addMouseMotionListener(object : MouseAdapter () {
312
312
override fun mouseMoved (e : MouseEvent ) {
313
- val slider = e.source as JSlider
314
- val mouseX = e.x
315
- val value = slider.minimum + (slider.maximum - slider.minimum) * mouseX / slider.width
316
- val duration = mediaPlayerComponent.mediaPlayer().media().info().duration()
317
- val position = value.toDouble() / slider.maximum
318
- val timeInMillis = (duration * position).toLong()
319
- val timeFormatted = timeFormatter.formatTime(timeInMillis / 1000f )
320
- slider.toolTipText = timeFormatted
313
+ if (mediaPlayerComponent.mediaPlayer().media().info() != null ) {
314
+ val slider = e.source as JSlider
315
+ val mouseX = e.x
316
+ val value = slider.minimum + (slider.maximum - slider.minimum) * mouseX / slider.width
317
+ val duration = mediaPlayerComponent.mediaPlayer().media().info().duration()
318
+ val position = value.toDouble() / slider.maximum
319
+ val timeInMillis = (duration * position).toLong()
320
+ val timeFormatted = timeFormatter.formatTime(timeInMillis / 1000f )
321
+ slider.toolTipText = timeFormatted
322
+ }
321
323
}
322
324
})
323
325
posText = JLabel (" 00:00:00" ).apply {
Original file line number Diff line number Diff line change @@ -73,7 +73,10 @@ class CastController(
73
73
fun switchToService () {
74
74
if (cuerCastPlayerWatcher.isWatching()) {
75
75
cuerCastPlayerWatcher.mainPlayerControls = null
76
- ytServiceManager.start()
76
+ if (cuerCastPlayerWatcher.isCommunicating()) {
77
+ // don't start service is player isn't running
78
+ ytServiceManager.start()
79
+ }
77
80
chromeCastHolder.destroy() // kills any existing chromecast session
78
81
} else if (chromeCastHolder.isCreated() && chromeCastHolder.isConnected()) {
79
82
ytServiceManager.start()
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ class CuerCastPlayerWatcher(
99
99
fun isWatching (): Boolean = remoteNode != null
100
100
101
101
fun isPlaying (): Boolean = state.lastMessage?.playbackState == PlayerStateDomain .PLAYING
102
+ fun isCommunicating (): Boolean = state.isCommunicating
102
103
103
104
fun attemptRestoreConnection (playerControls : PlayerContract .PlayerControls ) {
104
105
prefs.curecastRemoteNodeName
You can’t perform that action at this time.
0 commit comments