Package nl.harm27.obs.websocket.sender
Class MediaControlRequestSender
- java.lang.Object
-
- nl.harm27.obs.websocket.sender.RequestSender
-
- nl.harm27.obs.websocket.sender.MediaControlRequestSender
-
public class MediaControlRequestSender extends RequestSender
-
-
Constructor Summary
Constructors Constructor Description MediaControlRequestSender(BiConsumer<BaseRequest,Consumer<BaseResponse>> requestConsumer, Consumer<BaseRequest> batchConsumer, Supplier<String> messageIdSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetMediaDuration.Builder
getMediaDuration()
Get the length of media in milliseconds.GetMediaState.Builder
getMediaState()
Get the current playing state of a media source.GetMediaTime.Builder
getMediaTime()
Get the current timestamp of media in milliseconds.NextMedia.Builder
nextMedia()
Skip to the next media item in the playlist.PlayPauseMedia.Builder
playPauseMedia()
Pause or play a media source.PreviousMedia.Builder
previousMedia()
Go to the previous media item in the playlist.RestartMedia.Builder
restartMedia()
Restart a media source.ScrubMedia.Builder
scrubMedia()
Scrub media using a supplied offset.SetMediaTime.Builder
setMediaTime()
Set the timestamp of a media source.StopMedia.Builder
stopMedia()
Stop a media source.-
Methods inherited from class nl.harm27.obs.websocket.sender.RequestSender
batchMessage, getNewMessageId, sendMessage
-
-
-
-
Constructor Detail
-
MediaControlRequestSender
public MediaControlRequestSender(BiConsumer<BaseRequest,Consumer<BaseResponse>> requestConsumer, Consumer<BaseRequest> batchConsumer, Supplier<String> messageIdSupplier)
-
-
Method Detail
-
playPauseMedia
public PlayPauseMedia.Builder playPauseMedia()
Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) Note :Leaving out `playPause` toggles the current pause state- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
restartMedia
public RestartMedia.Builder restartMedia()
Restart a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
stopMedia
public StopMedia.Builder stopMedia()
Stop a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
nextMedia
public NextMedia.Builder nextMedia()
Skip to the next media item in the playlist. Supports only vlc media source (as of OBS v25.0.8)- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
previousMedia
public PreviousMedia.Builder previousMedia()
Go to the previous media item in the playlist. Supports only vlc media source (as of OBS v25.0.8)- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
getMediaDuration
public GetMediaDuration.Builder getMediaDuration()
Get the length of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) Note: For some reason, for the first 5 or so seconds that the media is playing, the total duration can be off by upwards of 50ms.- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
getMediaTime
public GetMediaTime.Builder getMediaTime()
Get the current timestamp of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
setMediaTime
public SetMediaTime.Builder setMediaTime()
Set the timestamp of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
scrubMedia
public ScrubMedia.Builder scrubMedia()
Scrub media using a supplied offset. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) Note: Due to processing/network delays, this request is not perfect. The processing rate of this request has also not been tested.- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
getMediaState
public GetMediaState.Builder getMediaState()
Get the current playing state of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)- Since:
- 4.9.0
- See Also:
- OBS WebSocket Documentation
-
-