Kodi Community Forum
Beta Instant Switch Kodi Player over network - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: Beta Instant Switch Kodi Player over network (/showthread.php?tid=331325)

Pages: 1 2


Instant Switch Kodi Player over network - merlux - 2018-04-26

Image  Instant Switch

Repo | Release

This litte script scans your network for currently playing Kodi machines. If one is found, it starts to play the exact same stream on the device you scanned from.
I think it's perfect to switch the film/episode from TV to tablet before going to bed. Or to continue watching when going for a smoke... Wink
It's BETA, every feedback is welcome!

Requirements
  • all devices wanted to switch from need to enable remote control with UPnP
  • all devices wanted to switch from need to enable control over HTTP
Thats it. The script needs only to be installed on the device you want to switch to.

Usage
Download the release zip and install in Kodi. When started, the script scans the network.
If a playing Kodi is found, its stream is taken and started on the searching device. The first start could take a while, since the network needs to be scanned.

Settings
  • Stop other device: When a stream is cloned, the Kodi originally playing is stopped.
  • Alternative port: If a device has an other HTTP control port, you can define it here.
  • Always scan at start: You can. But it's slow. Only if your devices often change IP.
  • Manual IPs: You can specify IPs which always will be scanned. UPnP is not really reliable, this is a good option.

Troubleshooting
Detection is a bit janky, so if devices are not found, doublecheck the enabled UPnP and HTTP and try scanning in the Settings.
If nothing helps, you define IPs manually in the settings. It's known that shield is not behaving well with UPnP.
 Also, you can see the current cached devices in the settings. If everything fails, enable Debug Logging and check the log.

Changelog
1.0.4
Added static ip settings
  1.0.3
Added dynamic player id
  1.0.2
Added alternative Port in settings. Added check for uninstalled plugin file-url
  1.0.1
Tweaked detection of other devices, added caching.
  1.0.0
Initial Release


Download: Release link, or directly from here (1.0.4)


RE: Instant Switch Kodi Player - natethomas - 2018-04-26

This is a really neat idea.


RE: Instant Switch Kodi Player - Karellen - 2018-04-26

Hello @merlux

Great idea.

I am using Kodi v17.6 on Win 10 for both computers. InstantSwitch can see my other Kodi instance which is playing a movie...

Image

But when I run InstantSwitch, I get No device is playing anything.... I do have a movie playing on my other Kodi instance. Here is the log if it helps... https://paste.ubuntu.com/p/fzbx5THW66/


RE: Instant Switch Kodi Player - DaVu - 2018-04-26

@merlux 

Also impressed by this idea.

Didn't test it yet. But as far as I understood (and from my little understanding in python) there's a check if there's something playing on the other Kodi instance and then that player will be used to push/stream the content to that player...

What happens with the media which is playing on the 'remote' machine? Does it stop the currently playing media and plays the media you send to it? So if someone is actually watching something on it you 'remotely' stop what the person is watching and play your own media on it?


RE: Instant Switch Kodi Player - merlux - 2018-04-26

Hi @Karellen 

Thanks for testing and thanks for the Log!
Accourding to the log the other device 192.168.0.20 does not respond. Currently a timeout of 1 second is used, but this should be enough for the json-rpc control commands.

Are you sure the IP is the one of the other device? If not, try setting the right one in the settings as manual IP.
Also, can you check which port the HTTP control of the other device is on? The Addon tries 80 and 8080 by default, but you can set an alternative port in the settings.

If nothing helps, could you provide another log where you run "Scan and cache..." from the settings? It provides a bit more information.


RE: Instant Switch Kodi Player - Karellen - 2018-04-26

Hi @merlux

My apologies. I forgot my other machine uses Port 8081. Got my two installations mixed up.

That is pretty amazing. The show just started playing right from where I had paused the show so I could come and respond to your post.

Great work!!!


RE: Instant Switch Kodi Player - merlux - 2018-04-26

Hi @DaVu 

Close. There is a check, and when another Kodi is found, its stream source is COPIED and played.

To clearify:
Kodi A plays "foo" from "http://my.server.com/foo.mp4"
Kodi B runs Instant Switch, finds A, starts playing "foo" from "http://my.server.com/foo.mp4", with time offset of Kodi A

That's basically it. Default behaviour is Kodi A stops playing as soon as the switch happens, but this can be disabled in the settings, so A continues to play. Whatever you prefer Wink

But no, you can't push media from B to A, sorry.


RE: Instant Switch Kodi Player - merlux - 2018-04-26

Thanks, glad to hear it works in your setup Smile
Did you place manual IP or did the scan work?


RE: Instant Switch Kodi Player - Karellen - 2018-04-26

I used the scan in the Settings box and it worked worked.


RE: Instant Switch Kodi Player over network - merlux - 2018-04-26

Awesome, so the scanning works. Had some problems with it since UPnP is not so stable...
Thanks for the feedback


RE: Instant Switch Kodi Player over network - jmh2002 - 2018-04-26

I added my IP addresses to be sure, and everything worked flawlessly first time. Totally awesome, I will use this often as I move around home during the day.

Please add it to the Kodi repo.

THANK YOU! Smile


Instant Switch Kodi Player over network - WildPhydeaux - 2018-04-27

This is a really interesting idea, nice work! I don't personally need this function for video but I wonder if it works for audio and if so, does it work for music playlists/party mode. I can certainly see starting a playlist of music on A and enabling B, C etc to play exactly what A is playing at the same time. Multi-room audio basically...

Cheers,
Robert


RE: Instant Switch Kodi Player over network - Lunatixz - 2018-04-27

(2018-04-27, 17:33)WildPhydeaux Wrote: This is a really interesting idea, nice work! I don't personally need this function for video but I wonder if it works for audio and if so, does it work for music playlists/party mode. I can certainly see starting a playlist of music on A and enabling B, C etc to play exactly what A is playing at the same time. Multi-room audio basically...

Cheers,
Robert
I wrote a Multi-Room plugin a few years ago that can sync multiple Kodi instances for a "multi-room" effect. it's called "Media Mirror" and can be found in my beta repository. When I have some time I'll clean up the project and submit to Kodi repo.


RE: Instant Switch Kodi Player over network - jmh2002 - 2018-04-27

There also used to be an addon called SendTo (https://forum.kodi.tv/showthread.php?tid=147178&highlight=sendto / https://github.com/robweber/script.sendto) which did similar things to these various addons but unfortunately it hasn't been supported for a few years.


RE: Instant Switch Kodi Player over network - WildPhydeaux - 2018-04-27

(2018-04-27, 17:39)Lunatixz Wrote:
(2018-04-27, 17:33)WildPhydeaux Wrote: This is a really interesting idea, nice work! I don't personally need this function for video but I wonder if it works for audio and if so, does it work for music playlists/party mode. I can certainly see starting a playlist of music on A and enabling B, C etc to play exactly what A is playing at the same time. Multi-room audio basically...

Cheers,
Robert
I wrote a Multi-Room plugin a few years ago that can sync multiple Kodi instances for a "multi-room" effect. it's called "Media Mirror" and can be found in my beta repository. When I have some time I'll clean up the project and submit to Kodi repo.
Way cool, Lunatixz! Be nice to have the same music playing in the house and my garage while doing renovation work..

Cheers,
Robert