-
Notifications
You must be signed in to change notification settings - Fork 1
/
PillarboxSessionCommands.kt
34 lines (27 loc) · 1.18 KB
/
PillarboxSessionCommands.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright (c) SRG SSR. All rights reserved.
* License information is available from the LICENSE file.
*/
package ch.srgssr.pillarbox.player.session
import android.os.Bundle
import androidx.media3.session.SessionCommand
internal object PillarboxSessionCommands {
const val SMOOTH_SEEKING_ARG = "pillarbox.smoothSeekingEnabled"
const val TRACKER_ENABLED_ARG = "pillarbox.trackerEnabled"
const val SMOOTH_SEEKING_ENABLED = "pillarbox.smooth.seeking.enabled"
const val TRACKER_ENABLED = "pillarbox.tracker.enabled"
/**
* Place holder command
*/
val COMMAND_SMOOTH_SEEKING_ENABLED = SessionCommand(SMOOTH_SEEKING_ENABLED, Bundle.EMPTY)
/**
* Place holder command
*/
val COMMAND_TRACKER_ENABLED = SessionCommand(TRACKER_ENABLED, Bundle.EMPTY)
fun setSmoothSeekingEnabled(smoothSeekingEnabled: Boolean): SessionCommand {
return SessionCommand(SMOOTH_SEEKING_ENABLED, Bundle().apply { putBoolean(SMOOTH_SEEKING_ARG, smoothSeekingEnabled) })
}
fun setTrackerEnabled(trackerEnabled: Boolean): SessionCommand {
return SessionCommand(TRACKER_ENABLED, Bundle().apply { putBoolean(TRACKER_ENABLED_ARG, trackerEnabled) })
}
}