-
-
Couldn't load subscription status.
- Fork 732
Description
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
Other
OBS Studio Version (Other)
28.0.3
obs-websocket Version
5.0.1
OBS Studio Log URL
https://obsproject.com/logs/I5BL7WZ0WjbXHYn_
OBS Studio Crash Log URL
No response
Expected Behavior
After calling TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP"), I expect to be able to start playing the Media Input again using TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_START").
Current Behavior
After calling TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP"), I cannot start to play the Media Input anymore using TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_START"). This is unexcepted.
Steps to Reproduce
- Call
TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP")to stop playing a media input. - Then call
TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_START")to start it again.
Anything else we should know?
When using WebSockets to stop playing a media input using TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP"), I cannot start to play the Media Input anymore using TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_START"). Looking at the source code (RequestHandler_MediaInputs.cpp), I can see that the implementation is not what I would expect;
case OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PLAY:
// Shoutout to whoever implemented this API call like this
obs_source_media_play_pause(input, false);
break;
case OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP:
obs_source_media_stop(input);
break;
case OBS_WEBSOCKET_MEDIA_INPUT_ACTION_RESTART:
// I'm only implementing this because I'm nice. I think its a really dumb action.
obs_source_media_restart(input);
break;
Thanks to the developer that put in that "dumb" action called "RESTART", because actually calling "RESTART" is the only option to start playing again. If this is proper, then why have a START and a RESTART? What would be the difference?
The implementation is not what I expect, and I hope you can agree.
ALSO: After calling TriggerMediaInputAction(InputName, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP"), I can't press PLAY in the UI anymore either... I have STOP it there and RESTART it to get it playing again...