Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Solved Play smb PC file from command line or url - ... how?
#1
Photo 
Can you help me out playing a (video) file that is located on my PC on my EM7680 Kodi Player using a command line/url?

Operating the player with the IR-remote is working flawlessly, including accessing the (samba) shares on my PC.
 
The web interface is enabled and working too. In the web interface I see an url when browsing my shared folders (ip address and names are fake ;-)

htp://192.178.118.217:8080/#browser/video/%3A%2F%2Fmypc%2FE%2FTV%2FSeries%2F3b%201992%2F

I googled around and found the commands that can be used, like PlayFile and PlayerControl(Play), I also found an example from someone using xbmcCmds/xbmc but I have not been able to find the correct syntax.

I tried all these commands in my browser but they all fail:
htp://192.178.118.217:8080/xbmcCmds/xbmc?command=PlayFile(://mypc/E/TV/Series/3b 1992/S02E01.mkv)
htp://192.178.118.217:8080/xbmcCmds/xbmc?command=PlayFile(%3A%2F%2Fmypc%2FE%2FTV%2FSeries%2F3b%201992%2FS02E01.mkv)
htp://192.178.118.217:8080/xbmcCmds/xbmc?command=PlayFile(://mypc/E/TV/Series/3b%2F1992/S02E01.mkv)
htp://192.178.118.217:8080/xbmcCmds/xbmc?command=PlayFile("://mypc/E/TV/Series/3b 1992/S02E01.mkv")
htp://192.178.118.217:8080/xbmcCmds/xbmc?command=PlayFile(%22%3A%2F%2Fmypc%2FE%2FTV%2FSeries%2F3b%201992%2FS02E01.mkv%22)

I simple Play command doesn't work either:
htp://192.178.118.217:8080/xbmcCmds/xbmc?command=PlayerControl(Play)

What am I doing wrong? Is the part after 8080 incorrect (the xbmcCmds/xbmc part) or something else?

Any help is appreciated...

note: I removed one t in each url to overcome the truncation of the lines so you can study the commands I used ;-)
Reply
#2
Isn't the Kore mobile phone app working for you? You should be able to control the EM7680 with it easily.
xbmcCmds/xbmc sounds a bit outdated though. Which version of Kodi is on the EM7680 device?
Reply
#3
(2022-02-11, 18:03)Klojum Wrote: Isn't the Kore mobile phone app working for you? You should be able to control the EM7680 with it easily.
xbmcCmds/xbmc sounds a bit outdated though. Which version of Kodi is on the EM7680 device?

Chorus version
2.4.4
Kodi version
17.6

I'm not looking for an app on a mobile to control the EM7680. I want to be able to manually enter a command in an URL to control the player.
Reply
#4
I'm focusing on the PlayPause command now. If I can get that to work I can take it from there. I found JSON API commands, hoping that would work but no luck:

192.138.138.237:8080/{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 0 }, "id": 1}

The result is:

File not found
Reply
#5
From a Windows command prompt you can use something like

Code:
curl -X POST -H "content-type:application/json" http://kodi:[email protected]:80/jsonrpc -d {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Player.PlayPause\",\"params\":{\"playerid\":1}}

suitably adjusted for your username and password, plus the IP address.

You need to have remote control enabled within Kodi (settings menu > service settings > control) for on this system or other system, depending on where your Kodi install is compared to where the terminal is running. You also need remote control via http enabled on the same screen (that's where you set up username and password).

The trick is to get all the escaping of the various commands right (mostly the quotes) which is where all the backslashes come from in the command.

You can do similar from a url by extracting the relevant bit from the curl and doing it via a web browser. Of course that also needs the correct settings in Kodi as well, as described.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#6
Reply
#7
Wink 
Reply
#8
Thread marked solved.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply

Logout Mark Read Team Forum Stats Members Help
Play smb PC file from command line or url - ... how?0