Author Topic: Send2: send playing media from one XBMC to another  (Read 13171 times)

0 Members and 1 Guest are viewing this topic.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Send2: send playing media from one XBMC to another
« on: January 09, 2015, 02:52:06 PM »
 ::banana UPDATE: now have send2 and pull from, and have a group for either Sql or MySql   ::banana 
NOTE: MySql is an advanced Database setup if you are not sure which group to use then use "Send2 & Pull From With out MySql" Below

UPDATE: Now works with file paths and urls, (thanks for the idea jitterjames) i tested it on a handful of streaming add-ons and all of them except youtube would resume where you left off, for personal media both XBMC'S need to have access to the file through network file share, the media does not have to be in your library though


I got the idea for this from the XBMC/KODI FORUM SendTo script http://forum.kodi.tv/showthread.php?tid=147178

this is used to send media or pull media (movies,episodes, and music) from one XBMC to another XBMC

simply say:
"Send to the Living Room" (or "Pull from the Living Room")

  • it will find the path to either the file or url that is being played
  • then do a stepback on the media (same as pushing left, in case it doesn't pause due to timing)
  • then stop the video
  • connects to the receiving xbmc
  • sends the stop command to stop playing media (if any)
  • resumes playing the sent media on the receiving xbmc, then pauses it
  • connects back to the sending xbmc
  • then goes to the home screen(on the sending xbmc)


Make sure to change the IP, port numbers, username and password to match System>>Services>>Webserver in xbmc on the XJson.SetConnection Actions


Send2 & Pull From (Advanced)
this one is used with MySql
Attached Below


Send2 & Pull From  With OUT MySql
if you are not sure then use this one
Attached Below


all of these commands use the same payload XML, I attached an example (xbmcIPs.xml) of what it should look like, you only need the last digits of your XBMC IP's (192.168.1.***) and what you want to call that device in the phrase field, the xbmcIPs.xml goes into your xbmc payload folder

NOTE: depending on the speed of your network you may have to adjust the vc.pause time, so the pause command gets sent at the right time

 
« Last Edit: March 28, 2016, 02:29:23 PM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: SendTo: send playing media from one XBMC to another
« Reply #1 on: January 09, 2015, 10:19:36 PM »
Wow. Very cool idea.

I guess this will only work if your multiple XBMCs are sharing a mysql database though? Otherwise they would not have matching ids.

I wonder if you could still swing it without using ids?

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #2 on: January 09, 2015, 10:27:33 PM »
I'm using a MySQL setup, however according to the link i shared, where i got the idea from, he claims his doesn't require a MySQL or path substitution to use his
"both must have access to the original source. MySQL and path subsititution are not necessary"

i don't understand python that well but from what i saw in his code it looked to me as if we where using similar xjson commands,

as for the ids im not sure if it would be possible if i get some extra time ill see what i can figure out

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #3 on: January 10, 2015, 12:17:26 AM »
Just got done testing it with out MySql and the way i have the command built it has to be added to library in order for it to get the right info, so i added a source to 2 of my computers that does not have a MySql server running on them and used the same network share paths and tried it... and it seems to work with out MySQL 

as for doing it with out the id i would imagine it would need the file path of the video and would still have to be shared over the network, I'm a newbie to python and xjson commands but i will see what i can figure out on how to get the file path from the now playing media  ;D
« Last Edit: April 07, 2015, 01:38:55 PM by PegLegTV »

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #4 on: January 10, 2015, 02:32:45 AM »
updated the command in the first post, it can now send url's from add-ons and media that both xbmc's have access to through file shares, personal media does not have to be in the library for this to work

http://voxcommando.com/forum/index.php?topic=1954.msg16839#msg16839


thanks for the idea jitterjames  8)
« Last Edit: January 13, 2015, 03:50:50 PM by PegLegTV »

keithj69

  • $upporter
  • Sr. Member
  • *****
  • Posts: 113
  • Karma: 7
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #5 on: January 15, 2015, 01:00:36 PM »
getting my kodi environment setup and i love this idea.  Thanks.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #6 on: January 15, 2015, 01:29:24 PM »
getting my kodi environment setup and i love this idea.  Thanks.

no problem,   :D

I'm working on adding it into my good night command so if previous command was pause then send to the bedroom else send Pandora,

NOTE: depending on the speed of your network you may have to adjust the vc.pause time, so the pause command gets sent at the right time
 

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #7 on: January 23, 2015, 07:54:56 PM »
After A LOT of testing  :bonk

I've found how to get it to pause every time when I send local media (media on my pc's)
still working on getting it to pause every time I send a url,

if it doesn't pause for you when you send a url, you can adjust the vc.pause that's in the logical command

I changed the command to use a payload.xml instead (my wife and kids fell in love with it and I had to add a command for all of my xbmc's 9 in total)


New Send to:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<command id="225" name="New Send To" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetActivePlayers</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>"playerid": (.*?),</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetItem</param>
      <param>"playerid":{Match.1},  "properties": ["file"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <params>
      <param>"item": {"file":"{item.file}"}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>send2</param>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>left</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>600</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>x</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>5500</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SetConnection</cmdType>
    <params>
      <param>192.168.1.{1}</param>
      <param>5680</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>x</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>2000</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>{LastResult} , "options":{ "resume":true }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{var.send2}&amp;&amp;{"file":"http</ifParams>
    <then>
      <action>
        <cmdType>VC.Pause</cmdType>
        <params>
          <param>1000</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.PlayPause</param>
          <param>"playerid":{Match.1},"play":false</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.PlayPause</param>
          <param>"playerid":{Match.1},"play":false</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>XJson.SetConnection</cmdType>
    <params>
      <param>192.168.1.140</param>
      <param>5680</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>GUI.ActivateWindow</param>
      <param>"window": "home"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Send to, Going to</phrase>
  <phrase optional="true">the</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcIPs.xml</payloadFromXML>
</command>

after you copy/paste this group you will need to edit the "xbmcIPs.xml" you will need the last digits of your IP's (192.168.1.***) in the value field
and the phrase you want in the phrase field
you will need to edit the IP on the xjson.setconnection action at the bottom of the command to the host PC's IP

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #8 on: February 13, 2015, 01:13:32 PM »
PegLegTV --  thank you so much for sharing -- this is really awesome.  I installed this last night and got it to work for the most part. 

The part that worked for me is that VC was able to send the video from my PC to my Mac and Fire TV installations.  However, I have a few kinks in the system.
First, it is sending the video and pausing it, but not at the time stamp of where the movie played up to on the PC (host).  Secondly, I'm getting "Results.RegEx:"name".*?"(.*)" error: no matches found.  I'm still trying to get my head around RegEx so don't have much insight as to what that means.  I know that when the video gets sent over, VC says now playing (and then blank on the movie title) starring (blank again).  When I play it on the PC, though, VC is able to read the title and actors from the XML. 

In any case, do you have any advice to fix these little things?


Also, I assume if you want to send from the target pc back to the host pc, the "target" would have to have VC installed and then set it up so that it can be a "host" pc as well -- to go the other way.  Am I right in that assumption?

I wonder if there's a way, instead, to just "retrieve" the video back to the PC.  A command like, "Bring video back from mac"?  It would almost be like handoff/continuity for Kodi!

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #9 on: February 13, 2015, 02:22:48 PM »
Quote
First, it is sending the video and pausing it, but not at the time stamp of where the movie played up to on the PC (host)

in the command it jumps back 30 second (XJson.Btn.KB-- left) before it stops, and it also has a command to pause (XJson.Raw-Player.PlayPause) the video on the receiving end so you don't miss anything while walking to the other room the 30 second jump back is in case it doesn't pause on the receiving end, so hopefully you wont miss any thing


Quote
Secondly, I'm getting "Results.RegEx:"name".*?"(.*)" error: no matches found.  I'm still trying to get my head around RegEx so don't have much insight as to what that means.

That is going to be the "XBMC.Player.OnPlay.movie" command that is giving that error, is the video in both xbmc library's, for that command to work it needs to read the XBMC ID of the video or music file so if there isn't one you would get this error, I would try it again and look for "XBMC.Player.OnPlay.movie" in the event panel and hover over it and see what it says to see if there is an error being thrown, also what version of VC are you running?


Quote
Also, I assume if you want to send from the target pc back to the host pc, the "target" would have to have VC installed and then set it up so that it can be a "host" pc as well -- to go the other way.  Am I right in that assumption?

I wonder if there's a way, instead, to just "retrieve" the video back to the PC.  A command like, "Bring video back from mac"?  It would almost be like handoff/continuity for Kodi!

This is what you can use to Pull from another PC (make sure you change all IP's and Port numbers for your setup)

PullFrom
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="329" name="Pull From" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.SetConnection</cmdType>
    <params>
      <param>192.168.1.{1}</param>
      <param>5680</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetActivePlayers</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>"playerid": (.*?),</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetItem</param>
      <param>"playerid":{Match.1},  "properties": ["file"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <params>
      <param>"item": {"file":"{item.file}"}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>send2</param>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>left</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>600</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>x</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>600</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>5500</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SetConnection</cmdType>
    <params>
      <param>192.168.1.140</param>
      <param>5680</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>x</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>2000</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>{LastResult} , "options":{ "resume":true }</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SetConnection</cmdType>
    <params>
      <param>192.168.1.{1}</param>
      <param>5680</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>100</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>GUI.ActivateWindow</param>
      <param>"window": "home"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>100</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SetConnection</cmdType>
    <params>
      <param>192.168.1.140</param>
      <param>5680</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>pull from, grab from</phrase>
  <phrase optional="true">the</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcIPs.xml</payloadFromXML>
</command>

you may also need to adjust the vc.pause commands to fit your network better

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #10 on: February 13, 2015, 05:16:32 PM »
PegLegTV -- thanks so much!

For me, it is passing the video to the other computer, but always at 0:0:0 paused, meaning the beginning of the movie, even if I'm halfway through on the PC (host).

As for XBMC.Player.OnPlay.movie
XJson.Raw:Player.GetItem&&"playerid":1,  "properties": ["title","cast"]
Results.RegEx:"name".*?"(.*)"

Rollover just states error: No matches found

Hovering over XBMC.Player.Onplay.movie, I see {1} No ID

I'm running the latest version of VC 2.1.3.8.

Thanks --I'll take a look at the "pull" command, makes this even more awesome.


BTW, for Xsql or Xjson -- I don't have much familiarity with those -- most of my movies have the full slate of metadata (VC announced Film title and who stars in it, but I've found some movies that doesn't have the actors information so VC just says starring [then nothing].  I've purged the cache, run the GenXML, but still persists, any advice on that for filling in the blank information?



PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #11 on: February 13, 2015, 06:42:26 PM »
Quote
As for XBMC.Player.OnPlay.movie
XJson.Raw:Player.GetItem&&"playerid":1,  "properties": ["title","cast"]
Results.RegEx:"name".*?"(.*)"

Rollover just states error: No matches found

Hovering over XBMC.Player.Onplay.movie, I see {1} No ID

the only time I see "{1} no ID" is when the video is not in my library so I just changed my XBMC.Player.OnPlay.movie command so it would ignore it if it had "{1} no ID"

XBMC.Player.OnPlay.movie: for "{1} no ID"
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="536" name="XBMC.Player.OnPlay.movie" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;no ID</ifParams>
    <then>
      <action>
        <cmdType>VC.StopMacro</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>TTS.SetVolume</cmdType>
    <params>
      <param>100</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetItem</param>
      <param>"playerid":1,  "properties": ["title","cast"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>"name".*?"(.*)"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <params>
      <param>, </param>
      <param>3</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <params>
      <param>Now Playing {item.title} Starring {lastresult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftMute</cmdType>
    <params>
      <param>60</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftUnMute</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>XBMC.Player.OnPlay.movie</event>
</command>


Quote
For me, it is passing the video to the other computer, but always at 0:0:0 paused, meaning the beginning of the movie, even if I'm halfway through on the PC (host).

I'll need to do some more testing on this to see if I can recreate the problem, the only time I've seen this is when sending youtube videos to other devices but that seems to be an issue with the youtube plugin not wanting to start in the middle of a video

Quote
BTW, for Xsql or Xjson -- I don't have much familiarity with those -- most of my movies have the full slate of metadata (VC announced Film title and who stars in it, but I've found some movies that doesn't have the actors information so VC just says starring [then nothing].  I've purged the cache, run the GenXML, but still persists, any advice on that for filling in the blank information?

with the xsql that is scaning a .db file that is created by xbmc so if that data isn't in the .db file then VC can't use it, you could check if the movies that are missing actors have them listed in the info screen in xbmc, if they aren't then you could try to edit an .nfo file if you use them and refresh that movie to see if it added those actors, if it did then you need to generate your xsql again and then try "what movie is this" to see if that added the actors.

jitterjames has the correct answer on this
Quote
jitterjames: I should also point out that the actions that get information about the currently playing media have nothing to do with GenXML.  When the onmovie event fires the command uses an xJson.Raw action to ask Kodi for the information about what is playing.  I think that Kodi does not know the ID of the now playing item because it was starting using a file path and not a library ID.  Again this could be solved by using MySql and passing the media ID instead of the path.
« Last Edit: February 14, 2015, 02:07:43 AM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: SendTo: send playing media from one XBMC to another
« Reply #12 on: February 13, 2015, 07:14:07 PM »
I think the problems Hiryu is having is related to the fact that you are not using the MySQL database so you do not have shared information between different Kodi machines.

The resume is not going to work because the new machine does not know where the old machine left off.  Actually, you may not always get a movie starting at 0:00.  If machine A tells machine B to resume a movie, it will resume wherever the movie was the last time that machine B stopped watching it.

In order for this to work as it is you will need to use a shared MySQL database for all your Kodi installations.  This is generally a good idea if you have one library and multiple Kodi machines.

I should also point out that the actions that get information about the currently playing media have nothing to do with GenXML.  When the onmovie event fires the command uses an xJson.Raw action to ask Kodi for the information about what is playing.  I think that Kodi does not know the ID of the now playing item because it was starting using a file path and not a library ID.  Again this could be solved by using MySql and passing the media ID instead of the path.

I hope this helps.

For information about how to set up MySQL please go to the Kodi forums and wiki.  It is well documented.
« Last Edit: February 13, 2015, 11:08:29 PM by jitterjames »

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #13 on: February 14, 2015, 09:44:29 AM »
Thanks -- I'll keep experimenting with this.  James, do I have to turn off the Xsql plugin if I use xMySql (is it only one or the other, don't want to run into conflicts).

Also, I've never used sql so very unfamiliar -- how do I check to see if MySql is working correctly?  Any good quick test?

I know this is asking for more help than just VC.  My Mac Mini is the server with all the hosted media files.  So I installed MySQL on that, turned it on, and also installed Kodi on there for good measure.  After adding all the advancedsettings.xml settings onto my PC instance of Kodi and re-starting it up, I check the xMySQL Plugin, go to the payload generator, and input the ip address of my server, user name and password (from Kodi Services, webserver).  The username and password are the same on all my instances of Kodi (Mac Mini, Macbook, and PC). 

When I try to "save and generate" the payload xml, I get Access denied for 'user'@'pc.home' (using password: YES) SCANNING ABORTED.  Any advice?  Am I doing something wrong here with the MySQL setup?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: SendTo: send playing media from one XBMC to another
« Reply #14 on: February 14, 2015, 10:23:49 AM »
Thanks -- I'll keep experimenting with this.  James, do I have to turn off the Xsql plugin if I use xMySql (is it only one or the other, don't want to run into conflicts).

Yes.  You should switch to using the xMySql plugin instead of the xSql plugin.  Or you can just use the xJson plugin to generate XML if your needs are simple.

As for the rest: http://kodi.wiki/view/MySQL

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #15 on: February 16, 2015, 11:54:37 AM »
Quote
When the onmovie event fires the command uses an xJson.Raw action to ask Kodi for the information about what is playing.  I think that Kodi does not know the ID of the now playing item because it was starting using a file path and not a library ID.  Again this could be solved by using MySql and passing the media ID instead of the path.

PegLegTV and Jitterjames,

After a lot of missteps and frustrating roadblocks, I finally figured out how to get a mysql server running (at least it seems to be working for now).  And it also seems that sending and pulling kodi works, with pauses at the correct time stamp (30 seconds back).  Thank you both!  I was reluctant to setup mysql since I am not very technically inclined and wasn't sure I could do it. 

Jitterjames -- also when you said that GenXML doesn't actually generate the information and really is just grabbing information from Kodi (which is generated from a scrape).  Where can I find the actual Kodi information if I wanted to change the data (say, if actors are missing).

The other question is, is there any way to exclude certain videos from VC announcing the name and actors?  I ask because I have a Screensaver add-on that cycles between a few videos (ambient visualizations, fireplace, etc.) but VC also announces those.  I want to exclude those from the list.  Sorry, don't really understand XJson.Raw so need some guidance. 

Do I just go into XBMCpayloads and look for, say, the fireplace entry and delete it?

Thanks!


Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #16 on: February 16, 2015, 12:01:19 PM »
Also, just want to say thank you again to PegLegTV and Jitterjames.  Really want you to know how much I appreciate your help.  Thanks!

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #17 on: February 16, 2015, 12:43:26 PM »
Quote
Jitterjames -- also when you said that GenXML doesn't actually generate the information and really is just grabbing information from Kodi (which is generated from a scrape).  Where can I find the actual Kodi information if I wanted to change the data (say, if actors are missing).
depending on what scraper you are using in XBMC/KODI you would need to go to that site and search for the movies that are missing actors and see if they are missing on that site if so you could try and add them and then remove the movie from you library and then re-add the movie so it scrapes the site again to see if that pulls in the actors, https://www.themoviedb.org/ this is the main movie scraper used in XBMC/KODI if that doesn't work you could try .NFO files with those movies and edit the .NFO file to add your actors http://kodi.wiki/view/NFO_files

Quote
The other question is, is there any way to exclude certain videos from VC announcing the name and actors?  I ask because I have a Screensaver add-on that cycles between a few videos (ambient visualizations, fireplace, etc.) but VC also announces those.  I want to exclude those from the list.  Sorry, don't really understand XJson.Raw so need some guidance.

Do I just go into XBMCpayloads and look for, say, the fireplace entry and delete it?

Deleting them from the xbmcMovieIDs.xml wouldn't be the long term answer being that every time you generate the xml it would just add them again, you could find the ID of the videos you don't want to play and add them in your command so the command stops if that ID is in payload 1

Stop VC from announcing specific video ID's
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="542" name="XBMC.Player.OnPlay.movie" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;no ID</ifParams>
    <then>
      <action>
        <cmdType>VC.StopMacro</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;ID you want to block</ifParams>
    <then>
      <action>
        <cmdType>VC.StopMacro</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>TTS.SetVolume</cmdType>
    <params>
      <param>100</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.GetItem</param>
      <param>"playerid":1,  "properties": ["title","cast"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>"name".*?"(.*)"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <params>
      <param>, </param>
      <param>3</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <params>
      <param>Now Playing {item.title} Starring {lastresult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftMute</cmdType>
    <params>
      <param>60</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftUnMute</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>XBMC.Player.OnPlay.movie</event>
</command>

In the command where it says "ID you want to block" replace that with the id of the video you don't want VC to announce


hope this helps, and Glad to here its working for you   :yay
« Last Edit: February 16, 2015, 12:52:10 PM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: SendTo: send playing media from one XBMC to another
« Reply #18 on: February 16, 2015, 12:45:51 PM »
Glad to hear you got it sorted out.  I personally consider using MySQL more trouble than it is worth but if you want share content and keep track of watched items across multiple installations it is definitely the best way.  This is one reason why MediaBrowser looks like an interesting alternative to Kodi, although I think it still need to mature a bit.

Jitterjames -- also when you said that GenXML doesn't actually generate the information and really is just grabbing information from Kodi (which is generated from a scrape).  Where can I find the actual Kodi information if I wanted to change the data (say, if actors are missing).
That is not what I said.  I said (or meant) that the VC command which announces songs is asking Kodi for information and that this has nothing to do with GenXML, and nothing to do with your PayloadXMLs.

If you want to edit metadata for items in your Kodi library I think you need to either do it in Kodi or in MySQL.

If actors are missing, then normally you don't need to do this manually, you just need to set Kodi up to automatically look for this information using scrapers.  I guess it depends on what kind of content you have in your library.  Certainly with mainstream English movies etc. it can always find this information automatically.  But this all a matter of learning how to use Kodi, not VC.

The other question is, is there any way to exclude certain videos from VC announcing the name and actors?  I ask because I have a Screensaver add-on that cycles between a few videos (ambient visualizations, fireplace, etc.) but VC also announces those.  I want to exclude those from the list.  Sorry, don't really understand XJson.Raw so need some guidance. 

Do I just go into XBMCpayloads and look for, say, the fireplace entry and delete it?

Thanks!
Again, editing your XBMC payloads will have absolutely no effect on this.  Those payloads are (normally) only used for creating the voice commands so that you can ask for media items by name.

If you want to exclude certain items then you need to find a way to identify those items.  If you can post a log of how the current command is working with normal items and then with the screensaver items, I can look to see if there is an easy way to differentiate between them.  It is probably just a question of using a logic block, and possibly a regex action.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #20 on: February 16, 2015, 01:04:29 PM »
Hahahaha -- yeah, mySQL was a bit of a bear for my situation.  Love tinkering with stuff, so getting it working was part of the pain/fun -- but I agree with you, JitterJames -- it was more trouble than it was worth for me.  Oh well, seems to be ok now.  I have taken a look at MediaBrowser in the past, and it just seemed a bit rough around the edges.  Maybe I'll take a look at it again.

Thanks guys -- I'll keep tinkering with this and see if I can make heads or tails out of the nfo.  Thanks PegLegTV -- I will try the code you posted.

You guys are awesome.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: SendTo: send playing media from one XBMC to another
« Reply #21 on: February 16, 2015, 01:16:18 PM »
Thanks guys -- I'll keep tinkering with this and see if I can make heads or tails out of the nfo.  Thanks PegLegTV -- I will try the code you posted.

You guys are awesome.

I recommend you post a log so we can come up with a better long term solution.  Otherwise you will be messing with IDs every time you want to add something new.

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #22 on: February 16, 2015, 01:43:11 PM »
HEy PLT,

Quote
In the command where it says "ID you want to block" replace that with the id of the video you don't want VC to announce

How do I figure out what the Video ID is?

As an example, I have a VideosID.xml that has "fireplace.mp4" in it as the only entry.  This xml is separate from the MoviesID.xml, which has all the movies loaded into Kodi.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #23 on: February 16, 2015, 01:55:47 PM »
you could play the video and then look in your history window on VC for the event "XBMC.Player.OnPlay.movie" and hover over it like you did when it was saying "no ID" and that should get you the ID

if the video that you are trying to stop VC from talking about has "no ID" then the command I shared should stop VC from talking as well

when testing the command I added "Stop VC from announcing specific video ID's" you will need to
Make sure you disable the group that has the original "XBMC.Player.OnPlay.movie" command in it other wise it will still annouce the video with TTS,

once you have the command I shared working like you want then you can delete the other "XBMC.Player.OnPlay.movie" and enable that group


Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #24 on: February 16, 2015, 03:28:12 PM »
PegLegTV -- yep, awesome, it works!  Thanks!  Good workaround since it has NoID.

Movies still play with VC TTS, but the screensavers, which have NoID don't announce anything.

And no need to mess around with the VideoIDs.  Thanks all.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: SendTo: send playing media from one XBMC to another
« Reply #25 on: February 16, 2015, 03:30:57 PM »
PegLegTV -- yep, awesome, it works!  Thanks!  Good workaround since it has NoID.

Movies still play with VC TTS, but the screensavers, which have NoID don't announce anything.

And no need to mess around with the VideoIDs.  Thanks all.


Glad to here it works, if it works with the "no ID" then i would delete the second logic block that says "ID you want to block" as that logic block is no long needed


MMatty1

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 4
    • View Profile
Re: Send2: send playing media from one XBMC to another
« Reply #27 on: March 14, 2018, 08:11:28 AM »
Hi just wondering if this will work with Jarvis and krypton? Thnxx in advancd

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Send2: send playing media from one XBMC to another
« Reply #28 on: March 15, 2018, 02:35:06 AM »
 Sorry for the delay, Yes it should work in both Jarvis and krypton

MMatty1

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 4
    • View Profile
Re: Send2: send playing media from one XBMC to another
« Reply #29 on: March 15, 2018, 04:31:07 AM »
Awesome thnxxx mate and great command too,and thnxx for the reply.. 😉