Beta Instant Switch Kodi Player over network
#1
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)
Reply
#2
This is a really neat idea.
Reply
#3
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/
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
@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?
Reply
#5
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.
Reply
#6
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!!!
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#7
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.
Reply
#8
Thanks, glad to hear it works in your setup Smile
Did you place manual IP or did the scan work?
Reply
#9
I used the scan in the Settings box and it worked worked.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#10
Awesome, so the scanning works. Had some problems with it since UPnP is not so stable...
Thanks for the feedback
Reply
#11
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
If I have helped you or increased your knowledge please click the 'Thumb Up - Like' button to show me your appreciation :)
For YouTube questions see the official thread here.
Reply
#12
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
Reply
#13
(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.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#14
There also used to be an addon called SendTo (https://forum.kodi.tv/showthread.php?tid...ght=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.
If I have helped you or increased your knowledge please click the 'Thumb Up - Like' button to show me your appreciation :)
For YouTube questions see the official thread here.
Reply
#15
(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
Reply

Logout Mark Read Team Forum Stats Members Help
Instant Switch Kodi Player over network0