What language or technology was used to develop the Spotify desktop application?

前端 未结 8 1813
南笙
南笙 2020-12-04 06:05

Does anybody know which language or technology was used to develop the Spotify desktop application? It\'s stable, good-looking and lightweight.

相关标签:
8条回答
  • 2020-12-04 06:26

    Here's the list of third-party components they use (on top of C++ of course):

    • Boost
    • Expat
    • FastDelegate
    • giflib
    • libjpeg
    • libogg
    • libvorbis
    • Mersenne Twister
    • zlib
    • NSIS (Windows only)
    • Windows Template Library (Windows only)
    • Growl (Max OS X only)
    • MATrackingArea (Mac OS X only)
    0 讨论(0)
  • 2020-12-04 06:27

    Check the first answer here: https://www.quora.com/What-is-the-technology-stack-behind-the-Spotify-web-client

    Andreas Blixt who is a former Technology Lead at Spotify has answered it in details.

    We have a PHP layer that deals with logging in (and some other server-side logic) as well as serving apps on different domains (for security reasons). The rest is all JavaScript.

    For the JavaScript to communicate with the backend, it does so via what we call an "access point" (AP), a highly optimized C++ service which can handle lots of active connections at once. This service is responsible for routing requests to the correct backend service. This service is capable of running over ports 80 and 443 to overcome firewall restrictions. The communication is done over WebSocket (or Flash for some browsers).

    To communicate with specific backend services, we route the requests through the AP using our own transport called "Hermes". This is basically a URL scheme that lets the AP know where to send the request. Payloads are encoded as Protobuf. Hermes has a nice caching system (we call it "Mercury") that stores results to IndexedDB for browsers that support it (we have the same system in the desktop client, but instead implemented in C++), to avoid requesting the same data twice. This is very useful for resources that get re-requested a lot, such as artists, albums and tracks.

    For the UI we have written a pretty advanced application framework (called "Stitch") for allowing every view to be developed independently by different teams without having to worry about breaking anything. The views run in a sandboxed , but can still depend on shared libraries for common things such as loading track metadata, etc. As of this writing we have ~35 unique views (or apps) in the web player.

    Views get data and perform actions via what we call a "bridge" (basically, an API) using postMessage, so that we don't need to reinitialize all the common code for every app. The really cool thing about this is that a lot of those ~35 views I mentioned before can actually also run inside the desktop client without modification. Of course, instead of postMessage they will be using a hook into Chromium Embedded Framework, and our C++ core.

    We try to use HTML 5 technologies as much as possible but in some cases depend on Flash. I think we have a really cool tech stack for our web player in general.

    0 讨论(0)
  • 2020-12-04 06:31

    From their website:

    Spotify is built mostly in Python and C++

    0 讨论(0)
  • 2020-12-04 06:33

    Given it's running on windows, clearly not .NET (Process explorer is telling me that), didn't follow a AIR install process, I'd say C++ using cross platform libraries.

    Everything is compiled down into one executable, which indicates they had access to the source of all dependencies.

    W.r.t to Techno...i think they used Hardhouse Electronica

    0 讨论(0)
  • 2020-12-04 06:40

    The frontend is written in FLEX, checkout the sources on your mac or windows machine. You will see a lot of xml file which are in the flex file format.

    Off course the connection to the server and platform integration is probably written natively in c++. But the UI part is just FLEX...

    0 讨论(0)
  • 2020-12-04 06:42

    From here: http://www.quora.com/What-is-the-technology-behind-the-Spotify-desktop-app
    Dated: 2014-09-09

    Andreas Blixt, 5-year Spotify employee:

    The core of all our clients is C++, but that core has since Rasmus's post gotten condensed, with functionality split out into modules. As Spotify becomes available on more and more platforms as well as getting a richer feature set, we need to ensure that "core" doesn't become "a little bit of everything". This has meant breaking out certain features, such as playback control, into their own separate modules. These modules are still C++ but are self-contained enough that their logic could theoretically be implemented in other languages. We call the interface layer to these modules "Cosmos", and it works in a way not too dissimilar from HTTP. Cosmos lets any part of the client communicate with a module using arbitrary paths and payloads, allowing for a much more flexible architecture. Some obvious benefits are versioned interfaces (example: GET sp://player/v1/main returns player state) and JSON for passing data around. This is important for another change in our desktop client.

    A lot of our desktop UI these days is actually using Chromium Embedded Framework (CEF), which basically means our views are powered by JavaScript, HTML and CSS. For all of our feature teams to be able to work on their features without fear of breaking someone else's view, each view is sandboxed in their own "browser" (I guess you can think of the views as tabs in Chrome, except we show more than one at a time). This brings with it one restriction though: sharing data between views gets more difficult. This is where Cosmos comes in and really simplifies the communication between core (C++) and JavaScript land: the JS clients can make arbitrary requests and if there's a binding, that request gets handled and responded to. One example is the "messages" endpoint which lets any view push JSON data out to any other view that's listening (kind of like window.postMessage in HTML5, except this one can also interface with C++ modules). This is also how all the play buttons in the client know whether a track is playing or not, or whether it's available offline (another Cosmos module), or whether you've saved a song to your music.

    Another important change to our technology stack is that we've moved some logic further "back", into view aggregation services. So where we would before do almost all logic in the clients, only using the backend as a data store, we now do much more work in a logic layer between the data stores and the clients, exposing endpoints very similar to Cosmos (in fact, you can call a backend the exact same way you call a Cosmos module, so moving between layers is not a hassle). The reason for this is two-fold: one, it lets us expand to more platforms more quickly because there's less client logic to implement and two, it really helps us keep our client behavior more consistent and up-to-date because the client is more "stupid". To mitigate any slowdown that might come from this we have ensured that there are caching rules for all data, so that the client will still keep data locally, it's just not responsible for as much business logic as it used to be.

    0 讨论(0)
提交回复
热议问题