Author Topic: what is the correct syntax for WMC play-video  (Read 12263 times)

0 Members and 1 Guest are viewing this topic.

bjohnson

  • Jr. Member
  • **
  • Posts: 2
  • Karma: 0
    • View Profile
what is the correct syntax for WMC play-video
« on: March 14, 2012, 02:03:23 PM »
I have spend 5 hours trying to play any video or tv and all I get is strange errors like the following.

WMC: <h1>ERROR
Command: play-video
Params: "c:
Returned: Exception -
See <a href='help'>Help[/url]</h1><HR><h1>ERROR
Command: video.wtv"
Params: No parameters specified.
Returned: BadRequest -
See <a href='help'>Help[/url]</h1>

Can anyone tell me what the correct syntax is for these?
WMC play-video "c:\video.wtv"
WMC play-tv "105" or WMC play-tv "KING"

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: what is the correct syntax for WMC play-video
« Reply #1 on: March 14, 2012, 04:37:16 PM »
First I recommend you switch to XBMC.

But if not...

I have never been able to figure out the correct syntax for this command.  The TCP controller plugin is also buggy and is not longer developed or supported in any way as far as I can tell.

But you can play a video file using the launch action in VoxCommando:

Provide the path to windows media center as the first action parameter and the path to the video file as the second action parameter.

example:

Launch     C:\Windows\ehome\ehshell.exe      F:\photos\102CANON\mvi_0071.avi

as for TV, I don't know.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: what is the correct syntax for WMC play-video
« Reply #2 on: February 25, 2014, 03:02:13 AM »
This play-video works fine in mControl. Haven't tested it...but got a similar error on another command with parameters.   However, it doesn't seem to work at all VC evn though I have a log from my current driver mControl.  My guess is it's not handling punctuation correctly.

The logic I use that is failing in VC ExtensibilityUrl (which goes to an html page that auto refreshes a camera, one html page per camera) is not working when fired from VOX.  For example, I wanted to create a command "Goto Front Door Camera":
* Goes to ExtensibilityUrl (TV program continues in small window on bottom left corner)
* After 20 Seconds, executes "WMC fullscreen" to return to playing program.

Here is the MControl Log that is working currently if that helps with the formatting:
Code: [Select]
2014-02-24 22:19:24.971 08:51:11.2874546 (033) I0 Broadcasted notification: ["EAVeraLuup:372", "Armed|Tripped"] for device [Mot-BY-Lawn]
2014-02-24 22:19:24.971 08:51:11.2875624 (033) D0 Device Status Changed event received: Device [Mot-BY-Lawn] status [TRIPPED=TRUE]
2014-02-24 22:19:25.476 08:51:11.7923833 (042) M0 [Cam-BY-Lawn] macro started by trigger [New Condition Group] (ID=1757FF9F)
2014-02-24 22:19:25.476 08:51:11.7925070 (042) M0 [Cam-BY-Lawn] macro action: [Macro - Cam-Now Playing] (ID=1757FF9F)
2014-02-24 22:19:25.531 08:51:11.8471956 (042) M0 [Cam-BY-Lawn] macro action: [Media Center "Go to" (ExtensibilityUrl|file:///C:/ProgramData/Microsoft/Windows/Start%20Menu/Programs/Accessories/Media%20Center/Media%20Center%20Programs/Cam-BY-Lawn.htm)] (ID=1757FF9F)
2014-02-24 22:19:25.531 08:51:11.8472655 (042) M0 Automation command [Media Center(1), 127.0.0.1|40500|40400, goto(ExtensibilityUrl|file:///C:/ProgramData/Microsoft/Windows/Start%20Menu/Programs/Accessories/Media%20Center/Media%20Center%20Programs/Cam-BY-Lawn.htm), 0, EAWmcControllerAdapter] (ID=1757FF9F)
2014-02-24 22:19:25.606 08:51:11.9253351 (021) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: FS_Extensibility=True
2014-02-24 22:19:25.606 08:51:11.9253936 (021) I0 Broadcasted notification: ["EAWmcControllerProtocol:127.0.0.1|40500|40400", "FS_Extensibility=True"] for device [Media Center]
2014-02-24 22:19:25.606 08:51:11.9257957 (021) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: 204 Success
2014-02-24 22:19:25.606 08:51:11.9258189 (021) I0 Broadcasted notification: ["EAWmcControllerProtocol:127.0.0.1|40500|40400", "204 Success"] for device [Media Center]
2014-02-24 22:19:25.636 08:51:11.9524169 (028) D0 EAWmcControllerAdapter - Media Center: message sent (W) through [127.0.0.1:40500]: [b]GOTO ExtensibilityUrl file:///C:/ProgramData/Microsoft/Windows/Start%20Menu/Programs/Accessories/Media%20Center/Media%20Center%20Programs/Cam-BY-Lawn.htm[/b]<cr><lf>
2014-02-24 22:19:25.821 08:51:12.1375672 (010) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: TrackTime=166

Here is an example of file video:
2014-02-24 22:16:38.877 08:48:25.1983487 (026) D0 EAVeraLuup: received message from device through [http://192.168.0.3:49451/]: <?xml version="1.0"?><u:RunSceneResponse xmlns:u="urn:schemas-micasaverde-org:service:HomeAutomationGateway:1"><OK>OK</OK></u:RunSceneResponse>
2014-02-24 22:16:39.362 08:48:25.6786448 (031) M0 [Bedtime Music] macro action: [Media Center "Play video" (file://s:/Documents/Alerts/TheSea.mp4)] (ID=394BA0E7)
2014-02-24 22:16:39.362 08:48:25.6787369 (031) M0 Automation command [Media Center(1), 127.0.0.1|40500|40400, play-video(file://s:/Documents/Alerts/TheSea.mp4), 0, EAWmcControllerAdapter] (ID=394BA0E7)
2014-02-24 22:16:39.367 08:48:25.6839044 (008) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: FS_Unknown=True
2014-02-24 22:16:39.367 08:48:25.6839044 (006) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: EndSession=15
2014-02-24 22:16:39.367 08:48:25.6839695 (008) I0 Broadcasted notification: ["EAWmcControllerProtocol:127.0.0.1|40500|40400", "FS_Unknown=True"] for device [Media Center]
2014-02-24 22:16:39.367 08:48:25.6845722 (006) I0 Broadcasted notification: ["EAWmcControllerProtocol:127.0.0.1|40500|40400", "FS_Unknown=True"] for device [Media Center]
2014-02-24 22:16:39.372 08:48:25.6926354 (035) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: StartSession=16
2014-02-24 22:16:39.372 08:48:25.6926723 (035) I0 Broadcasted notification: ["EAWmcControllerProtocol:127.0.0.1|40500|40400", "StartSession=16"] for device [Media Center]
2014-02-24 22:16:39.372 08:48:25.6928074 (008) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: FS_Videos=True
2014-02-24 22:16:39.372 08:48:25.6928269 (008) I0 Broadcasted notification: ["EAWmcControllerProtocol:127.0.0.1|40500|40400", "FS_Videos=True"] for device [Media Center]
2014-02-24 22:16:39.372 08:48:25.6928837 (035) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: StreamingContentVideo=True
2014-02-24 22:16:39.372 08:48:25.6929266 (035) I0 Broadcasted notification: ["EAWmcControllerProtocol:127.0.0.1|40500|40400", "StreamingContentVideo=True"] for device [Media Center]
2014-02-24 22:16:39.463 08:48:25.7795882 (036) D0 EAWmcControllerAdapter - Media Center: message sent (W) through [127.0.0.1:40500]: [b]PLAY-VIDEO file://s:/Documents/Alerts/TheSea.mp4[/b]<cr><lf>
2014-02-24 22:16:39.585 08:48:25.9043132 (006) D0 EAWmcControllerAdapter - Media Center: received message from device through [127.0.0.1:40500]: StartSession=17
As soon as I can get this to work, I can finally ditch mControl (whom had a great vision, but their support takes months to respond and shuttered there forums (can't register as new user for over a year).
« Last Edit: January 04, 2015, 08:59:02 PM by nime5ter »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: what is the correct syntax for WMC play-video
« Reply #3 on: February 25, 2014, 08:33:10 AM »
I am afraid I can't make sense of anything you are saying here.  If you get a chance could you maybe rephrase?

If you need help with a VC command that is not working the way you expect, please post your command XML, explain what you think should be happening, and what is actually happening, etc.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: what is the correct syntax for WMC play-video
« Reply #4 on: February 25, 2014, 11:51:05 AM »
It is not a problem with VMC Controller where I can make all this work today...the problem is with VC.  I suspect it is the way VoxCommando is parsing the commands with punctuation.

The below commands work in other programs or telnet, but fail when being run through VC to WMC.

* GOTO ExtensibilityUrl file:///C:/ProgramData/Microsoft/Windows/Start%20Menu/Programs/Accessories/Media%20Center/Media%20Center%20Programs/Cam-BY-Lawn.htm
* PLAY-VIDEO file://s:/Documents/Alerts/TheSea.mp4

I'm trying remove VMCController as the issue as it's working fine with other applications...just not VC.


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: what is the correct syntax for WMC play-video
« Reply #5 on: February 25, 2014, 04:43:32 PM »
Yes.  the problem is that a long time ago, back when I thought it might be worth making this plugin for WMC/VMC I chose to use the HTTP interface to talk to VMC.

That interface is a bit kaka.  And because the VMC plugin was not being developed or supported, and because I don't use WMC, I did not look at this for a couple of years.

I don't think it is even possible to send the UNC paths correctly using an http query string so the only solution is to use TCP instead.  the VMC plugin supports this on port 40500.  At the time that I originally wrote my code I did not know how to use that.  Now I do, so I will see about updating the WMC plugin for Version 2 of VC.

In the mean time you can use the TCP plugin and it works just fine.  You can either use a client to stay connected, or just use sendsingle which connects, sends a command, and disconnects.

This works to play a video file:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="1152" name="wmc tcp single" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TCP.Single.Write</cmdType>
    <cmdString>play-video J:\Rolls\20120823 Mushrooms\awesome river-socks.mp4 \x0A&amp;&amp;localhost&amp;&amp;40500</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>