File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/kotlin/dev/silenium/multimedia/compose/player Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ class VideoPlayer(hwdec: Boolean = false) : AutoCloseable {
3737 @InternalMultimediaApi
3838 suspend fun command (vararg command : String ) = mpv.commandAsync(command.toList().toTypedArray())
3939
40- suspend fun toggleFullscreen () = mpv.commandAsync(" cycle" , " fullscreen" )
4140 suspend fun togglePause () = mpv.commandAsync(" cycle" , " pause" )
4241 suspend fun toggleMute () = mpv.commandAsync(" cycle" , " mute" )
4342 suspend fun setVolume (volume : Long ) = mpv.commandAsync(" set" , " volume" , volume.toString())
@@ -55,9 +54,9 @@ class VideoPlayer(hwdec: Boolean = false) : AutoCloseable {
5554 mpv.setOption(it.key, it.value)
5655 }
5756 mpv.initialize().getOrThrow()
58- mpv.setProperty( " loop " , false ).getOrThrow()
59- mpv.setProperty(" keep-open " , " yes " ).getOrThrow()
60- mpv.setProperty( " ao-volume " , 100 ).getOrNull() // ignore errors
57+ initProperties.forEach {
58+ mpv.setProperty(it.key, it.value).getOrNull() // ignore errors
59+ }
6160 return mpv
6261 }
6362
@@ -94,6 +93,7 @@ class VideoPlayer(hwdec: Boolean = false) : AutoCloseable {
9493 private val initProperties = mapOf (
9594 " loop" to " inf" ,
9695 " keep-open" to " yes" ,
96+ " ao-volume" to " 100" ,
9797 )
9898 }
9999}
You can’t perform that action at this time.
0 commit comments