INTERACT FORUM

Please login or register.

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

Author Topic: Can't play video files via MCWS  (Read 939 times)

avid

  • Regular Member
  • World Citizen
  • ***
  • Posts: 180
  • MC user since 2003
Can't play video files via MCWS
« on: July 26, 2023, 06:01:05 am »

Maybe it's a URL encoding problem, but I can't see it.

When I try to play a video file via MCWS it doesn't do anything, though returns status OK. Not quite true - if there is anything already in the queue, it starts playing that, but it won't replace the queue or add to it. So that means it is recognising some sort of play command.

So I can successfully play a file with (e.g.)
Code: [Select]
mc31 /replace "D:\Video\This Is Spinal Tap.mpg"
But if I use MCWS, neither of these do anything:
Code: [Select]
http://localhost:52199/MCWS/v1/Playback/PlayByFilename?Filenames=D%3a%5cVideo%5cThis+Is+Spinal+Tap.mpgor
Code: [Select]
http://localhost:52199/MCWS/v1/Control/CommandLine?Arguments=%22/Replace+D%3a%5cVideo%5cThis+Is+Spinal+Tap.mpg%22
Different values of "Location" seem to make no difference.

Any ideas? Does it need non-standard URL encoding?

If I get absolutely desperate, I will explicitly launch a "mc31" sub-process to do this, but that seems horrible!!
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10931
Re: Can't play video files via MCWS
« Reply #1 on: July 26, 2023, 06:28:40 am »

Try using %20 for spaces, I'm not sure the + shortcut works in filenames.
Logged
~ nevcairiel
~ Author of LAV Filters

avid

  • Regular Member
  • World Citizen
  • ***
  • Posts: 180
  • MC user since 2003
Re: Can't play video files via MCWS
« Reply #2 on: July 26, 2023, 07:00:13 am »

Thank you - that was it. So it's as I guessed - a non-standard understanding of URL encoding.

My .Net software controlling MC uses the standard library URLEncode() function:
Code: [Select]
SendMCWS("Playback/PlayByFilename?Filenames=" + HttpUtility.UrlEncode(path));But I will trivially post process the encoded string to turn "+" into "%20" and all should be well.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10931
Re: Can't play video files via MCWS
« Reply #3 on: July 26, 2023, 09:01:56 am »

I can probably make it handle + in there. Its handled in some spots but might have been forgotten there.
Logged
~ nevcairiel
~ Author of LAV Filters
Pages: [1]   Go Up