INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MCWS: playback/position endpoint is not working as documented  (Read 827 times)

DrKNo

  • World Citizen
  • ***
  • Posts: 201

Put curtly, the examples in the mcws API do not result in the intended behaviour when clicking them. specifically, I believe the "relative" parameter is ignored.

e.g.:
Code: [Select]
http://localhost:52199/MCWS/v1/Playback/Position?Position=-1&Relative=-1Should result in default rewind, but sets play position to -10000ms

I am unsure if this is a regression (I was under the impression it worked in MC24, but I'm not sure...).
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS: playback/position endpoint is not working as documented
« Reply #1 on: March 23, 2020, 02:07:19 pm »

That's because the value of -1 gets special handling.

This seeks back two seconds reliably for me:
http://localhost:52199/MCWS/v1/Playback/Position?Position=2000&Relative=-1
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS: playback/position endpoint is not working as documented
« Reply #2 on: March 23, 2020, 02:08:20 pm »

-1 loads the seek value from the playback engine using the user settings.
Logged
Matt Ashland, JRiver Media Center

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #3 on: March 23, 2020, 02:12:08 pm »

How would I realise a default time rewind then? This is the description of the example I gave: "Jump backward (default amount)", the behaviour is o jump to -10000 though, ignoring playback position. Maybe relative is ignored only when the default value -1 is used?
So at the least, I think the examples should be updated.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #4 on: March 23, 2020, 02:12:59 pm »

PS: Thank you for the quick reply as always, Matt. Much appreciated.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS: playback/position endpoint is not working as documented
« Reply #5 on: March 23, 2020, 02:15:52 pm »

This example:
Jump backward (default amount)

Loads the back jump from Options > Audio > Stop, Seek & Skip > Jump behavior

It seems pretty clean to me, but just let me know if we can somehow clarify the example.  Thanks.
Logged
Matt Ashland, JRiver Media Center

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #6 on: March 23, 2020, 02:24:18 pm »

Thank you Matt. I'm sorry for not communicating clearly, English is not my first language.

What I would expect the given call to do is to seek backward 10 seconds, as given in the options and as explained in the description. What it does is setting the playback position to -10000, resulting in playback from 0:00, irrespective of the previous position (like if the relative parameter was ignored).
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS: playback/position endpoint is not working as documented
« Reply #7 on: March 23, 2020, 02:30:22 pm »

Yes, we seek back the specified seek amount to the start of the song.  If you seek back more, we just bump against the bound of the song.

We do not seek to the previous track.

This seems reasonable to me.
Logged
Matt Ashland, JRiver Media Center

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #8 on: March 23, 2020, 02:44:11 pm »

Again, my apologies. Another example: The play head is at 120000 ms (2 minutes).
I click the example. I expect the playhead to be set to 120000 + (-10000) = 110000 ms (1 min 50 sec) from the options. But the play head is SET TO (not moved by) -10000 ms, resulting in the api call returning -10000 as position and playback commencing from 0ms. That is not seeking or rewinding. It is setting the position. The same happens when I call the endpoint with position =-1 and relative =1: The playback is SET TO 30000ms, no matter if it was at 0ms, 120000 ms or elsewhere.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #9 on: March 23, 2020, 02:47:28 pm »

Hence my conclusion: If the default position of -1 is used in MCWS, the relative parameter is ignored.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933
Re: MCWS: playback/position endpoint is not working as documented
« Reply #10 on: March 23, 2020, 02:55:01 pm »

The code seems to be pretty clear for the behavior, and I don't see how it would go wrong, unless you possibly re-configured the default jump times to be something unexpectedly long for a backwards seek?
The relative parameter is always checked before the requested position is ever evaluated.

I just tested it here and it works as expected during playback as well.
Logged
~ nevcairiel
~ Author of LAV Filters

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #11 on: March 23, 2020, 03:02:04 pm »

Weird. I double checked the options, it says 10/30 for rewind and fast forward. And it doesn't explain the fast forward behavior, that is always set to 30 seconds, does it?

Are there any other options that influence this behavior?
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #12 on: March 23, 2020, 03:17:17 pm »

I think I found it! It works on the Library server, it does not work on a client!
I made this call on a Library client! The action happens on the server, but apparently the relative parameter is not forwarded somehow. Im researching this some more.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: MCWS: playback/position endpoint is not working as documented
« Reply #13 on: March 23, 2020, 03:30:27 pm »

This is what I found. Server is S, Client is C

API call on C, Playback on C: Works as expected
API call on C, playback on zone local to S: Relative is ignored
API call on S, playback on zone local to S: as expected
API call on S, playback on Zone local to C: Relative is ignored
Logged
Pages: [1]   Go Up