Author Topic: Mobile web plugin  (Read 65790 times)

kogash

  • Guest
So how do I access my MusicBee via the smartphone? What address do I have to enter there in order to access this?

HAving your smartphone in same network that your pc (same wifi for instance). The adress is:

http://[yourpc internal ip address]:[port configured in musicbee options]

For example:

http://192.168.1.2:8080

Take in account that your pc may have some firewall preventing inbound connections. If you don't know where to see your pc internal ip address you can refer to one of theese manuals:

http://www.ehow.com/how_5274191_internal-ip-address-windows.html
http://www.ehow.com/video_4982579_find-computer-ip-address-windows.html
http://www.ehow.com/how_5621076_ip-address-windows-7.html

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34350
Rating and keybinds have nothing to do, I use api functions to change the ratings. Keep in mind that even if you change a rating you will not see it in musicbee interface until you change the current playing song (seems a bug with "now playing" interface in musicbee)
call MB_RefreshPanels() to make MB refresh the GUI with new values

kogash

  • Guest
Thank u very much! i didn't know it, i will make a call after updating the rating

Edit: Added version 0.3.1 to add that
Last Edit: January 06, 2013, 06:50:45 PM by kogash

kogash

  • Guest
Version 0.3.2 gets minor changes to now playing screen to make it more compact and usable controls

V4lve

  • Sr. Member
  • ****
  • Posts: 265
Hi. I am really liking this for the search and download function.  Unfortunately search doesn't seem to do anything and download always downloads the same file regarldess of the one I pick.

Grismar

  • Guest
Heya kogash,

I asked about people writing a web API in another thread and Steven mentioned that you were writing a web app at least. I just installed it and look pretty sweet sofar :).

I've been taking the technical approach of writing a web API first, so I'm basically trying to get every function call in the API to literally translate to a function call you can easily use from any language (Java, JavaScript like you, Python, Ruby, whatever as long as it has web access). So, quite a different approach, but I did notice you make JSON calls to get stuff from the back end.

If you're fine with the way things are on your end, I can only wish you good luck. But if you've run into problems or if you need features and are unsure how to get them in your web app, drop me a line, perhaps we can help each other out.

One thing I'm doing differently is I noticed you poll the server for updates, which makes your app respond with a small delay to what others are doing. I've chosen the slightly more complex route of long polling for events, but the Javascript side of things is surprisingly simple, all the complexity is in my plugin.

Another thing that's different is that you seem to have decided on making a somewhat REST-like custom web API, tailored for your app and to allow customization on the level of "skinning" (though web stuff gives skinners more flexibility than just skins). I've decided to follow the conventions of Steve's .Net API, basically exposing every function as close as possible to the original as a web service.

If you have some feedback on why you made the choices you did or if you have unsolved conundrums, please let me know. Either here or on [email protected]

Meanwhile, I'll continue work on my plugin - once I get to say 90% of API functionality, I'll post a version for people to give a whirl.

kogash

  • Guest
Hi. I am really liking this for the search and download function.  Unfortunately search doesn't seem to do anything and download always downloads the same file regarldess of the one I pick.

Uploading Version 0.3.3 to solve those issues!

kogash

  • Guest
Quote
Heya kogash,

I asked about people writing a web API in another thread and Steven mentioned that you were writing a web app at least. I just installed it and look pretty sweet sofar :).

I'm so happy that you liked it :D

Quote
If you're fine with the way things are on your end, I can only wish you good luck. But if you've run into problems or if you need features and are unsure how to get them in your web app, drop me a line, perhaps we can help each other out.
I have a quite experience in doing that kind of stuff but i will count on you, more so if you want the source of my current app ask for it! If I can be of any help, count on me too

Quote
One thing I'm doing differently is I noticed you poll the server for updates, which makes your app respond with a small delay to what others are doing. I've chosen the slightly more complex route of long polling for events, but the JavaScript side of things is surprisingly simple, all the complexity is in my plugin.

I thought about implementing a comet message passing, even more, I have part of the code commented on the assembly. But as you can read from my first post it all started as a quick hack for a news year party, long polling was totally out of scope  :D

Quote
Another thing that's different is that you seem to have decided on making a somewhat REST-like custom web API, tailored for your app and to allow customization on the level of "skinning"
I chose Rest-like api just because it was the faster option to implement. The assembly has a VERY simple http server and my needs are so simple so rest was the obvious choose. Something more complicated such as soap or xml-rpc was too much for a quick hack :D

Quote
  (though web stuff gives skinners more flexibility than just skins). I've decided to follow the conventions of Steve's .Net API, basically exposing every function as close as possible to the original as a web service.

Great for maintenance, but maybe it's not a good idea to mimic the full as is on a web service. Take in account that there are a lot of functions that are dangerous to expose or require input validation before allowing it to go to music bee...  even more some functions assume that you are working in .net as the getartwork ones where you receive a base64 encoded bitmap... not so practical for web uses.

If you want to expose the full api you have not even to make a bridge, all the functions are SOAP types compatible.
There’s another added problem, Steven api does not seem to be planned in any way. It grows and evolves at developers need, which is great for new features but makes it quite unstable and being undocumented does not help, so the maintenance benefit is not as big as it seems
Quote
Meanwhile, I'll continue work on my plugin - once I get to say 90% of API functionality, I'll post a version for people to give a whirl.

I will take a look when you have it "beta ready" and if you are ok with it i will change my plugin to use your api. I don't see any reason not to "reinvent" it on my code.

Even more if do you want we can collaborate on that project and make mine an "example implementation" of the web api.

V4lve

  • Sr. Member
  • ****
  • Posts: 265
Hi. I am really liking this for the search and download function.  Unfortunately search doesn't seem to do anything and download always downloads the same file regarldess of the one I pick.

Uploading Version 0.3.3 to solve those issues!

Hey.  I think you put the wrong DLL in the archive    ;D

kogash

  • Guest

bsgb

  • Newbie
  • *
  • Posts: 6
I updated and it now seems to work reliably, awesome! I was using IE10 on Windows Phone by the way.

Thinking about making a portrait friendly skin

Grismar

  • Guest
if you want the source of my current app ask for it! If I can be of any help, count on me too

Well, if you're willing to do some beta testing, that would be a major help already. And if by the end of that you still feel it's a good idea to move your app over to my API, that'd be great.

I thought about implementing a comet message passing, even more, I have part of the code commented on the assembly. But as you can read from my first post it all started as a quick hack for a news year party, long polling was totally out of scope  :D

Yeah, I figured as much, taking the slower approach on my end - hope the party was a success :).

Great for maintenance, but maybe it's not a good idea to mimic the full as is on a web service. Take in account that there are a lot of functions that are dangerous to expose or require input validation before allowing it to go to music bee...  even more some functions assume that you are working in .net as the getartwork ones where you receive a base64 encoded bitmap... not so practical for web uses.

I agree, though I would not expect anyone to expose this web service to anything but the local LAN. Still, to be able to use it in the workplace or in a public location, you're right - there should be some restrictions and security.

I didn't have too much trouble with the base64 encoded images - I actually kinda liked the speed of it, so I'm a bit miffed that Steve is now considering dropping it :(.

But I do agree that some of the functions don't make all that much sense in a web service, whereas others would require some security. For the applications I have in mind, I don't need to do anything like modifying metadata, so I will probably just skip that functionality. Or perhaps add an option to the configuration panel where you can simple disable that entire category of functions.

For now, I don't want to have to implement authentication or anything of the sort, so the web service should be maximally useful, with a minimum of risk - meanwhile staying as close to the original as possible.

Quote
Even more if do you want we can collaborate on that project and make mine an "example implementation" of the web api.

Sounds great, but first I will focus on getting some sort of beta out, then once it takes a beating, we can head that way :).

Out of curiosity, what do you use for a web server in your plugin? I picked a fairly decent embedded web server by the name of HybridDSP.Net HTTPServer, curious to hear what you're hosting your application in, or what you're embedding.

kogash

  • Guest
Thinking about making a portrait friendly skin

Great! Feel free to ask for anything you need if you decide to do that!

kogash

  • Guest
Well, if you're willing to do some beta testing, that would be a major help already. And if by the end of that you still feel it's a good idea to move your app over to my API, that'd be great.

Of curse, drop me a link when you have something enough mature

I didn't have too much trouble with the base64 encoded images - I actually kinda liked the speed of it, so I'm a bit miffed that Steve is now considering dropping it :(.

Not difficult but inconvenient, imagine a JavaScript consumer or a simple browser  having to use canvas or inline-encoded images... awful , not using cache... not a great way to pass an image in a web enviroment.

But I do agree that some of the functions don't make all that much sense in a web service, whereas others would require some security.

Keep in mind that some functions are accepting full local paths ... path traversing, accessing confidential data or deleting unsuspected files is something that should be avoided... we don't want to make a plugin that opens that kind of holes in our users computer. Nevertheless sure you have figured it in your tests. :D

For now, I don't want to have to implement authentication or anything of the sort, so the web service should be maximally useful, with a minimum of risk - meanwhile staying as close to the original as possible.

Android plugin developer solved it with an ip mask filter... but sooner or later we will need to implement security in a way or another

Out of curiosity, what do you use for a web server in your plugin? I picked a fairly decent embedded web server by the name of HybridDSP.Net HTTPServer, curious to hear what you're hosting your application in, or what you're embedding.

I've started with a VERY naive implementation from here (http://www.codeproject.com/Articles/137979/Simple-HTTP-Server-in-C) that basically only exposes a http header parser and a socket abstraction and i've implemented a file server, cache control, querystring parsing and localization suport (nothing spectacular, just functional), i'll take a look to that http server :D

Roadrunner

  • Sr. Member
  • ****
  • Posts: 373
Hi. I am really liking this for the search and download function.  Unfortunately search doesn't seem to do anything and download always downloads the same file regarldess of the one I pick.

Uploading Version 0.3.3 to solve those issues!
I tried the new 0.3.3 and the search seems to do still nothing (Firefox 17.0.1). Does this function need some special webserver permissions? Or do I have to do more than enter a search word and pressing Enter?