Closed chetanmekha closed 7 years ago
Hi chetanmekha, It depend of your currently playing song source, can you describe to me your test process to reproduce the exception ?
Thanks for quick reply.
My test case is,
I am passing audio file uri like as
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()+"/Heropanti.mp3"); String path = uri.getPath(); SonosDevice sonos = new SonosDevice("192.168.43.40"); sonos.playUri(path,"Testing data");
and getting UPnPSonosControllerException.
SonosDevice.previous(); also not working.. :(
It's from an Android phone ?
yes, I am trying to play audio file from android app.
I think it doesn't work because the Sonos cannot access to the file URI. Can u attempt with a file hosted on the web ?
Thanks for the help. Can we achieve something like as, Stop currently playing song on sonos device, play my announcement(from app) on sonos and resume previously running song if it was running from other devices like as Sonos Controller. It's implemented in https://github.com/jishi/node-sonos-http-api
I achieved it in android app.. :) Using nanoHTTPD . Need your help for second point.
You use nanoHTTPD for expose your mp3 ?
This feature is not on the library for the moment, i add it to the todo list ;)
Yes, with nanoHTTPD i created a light weight server within app and host the media file over it. The previous() method not working will you please check it. Also Is there any method available which returns current running song details? Like as uri, getduration(), getInfo() etc.
The feature you ask is now on sonos-controller ! SonosDevice.clip()
Have fun 😄
Thanks you vmichalak.. You achieve with nanoHttp or implemented with other technique?
I've made a webserver directly on the phone in java to expose phone medias and i use Clip to send it to sonos system :)
Great job man, and play previous song functionality also implemented? Let's connect on skype , please share your skype id
We have a slack channel (check on the readme.md). Join us on it !
And yes, SonosDevice.previous() do the job ;-)
Hello Vmichalak, Thanks for such a great library. I am successfully able to perform operation like as pause,play from android app to sonos. But when i tried with method playUri(String uri,String meta) it 's giving me UPnPSonosControllerException. How can i overcome this error. Also I want to achieve below functionality, Stop currently playing song on sonos device, play my announcement(from app) on sonos and resume previously running song if it was running from other devices like as Sonos Controller. Will it be possible to achieve this from your code?