使用什么语言或技术来开发 Spotify 桌面应用程序?

发布于 2024-07-15 06:20:47 字数 1815 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

野味少女 2024-07-22 06:20:48
  • 问题跟踪器:

    • 哨兵
  • 安全性:

    • 验证码
  • 其他:

    • Spotify 网站
    • 渐进式Web应用
    • 亚马逊S3
  • 标签管理器:

    • Google 跟踪代码管理器
  • JavaScript 库:

    • core-js 3.24.0
    • Reactjs
  • PaaS:

    • 亚马逊网络服务
    • 反向代理
  • Envoy:

    • Cookie 合规性
  • 其他:

    • OneTrust
    • A/B 测试
    • Google 优化
  • Issue trackers:

    • Sentry
  • Security:

    • reCAPTCHA
  • Miscellaneous:

    • Spotify Web
    • PWA
    • Amazon S3
  • Tag managers:

    • Google Tag Manager
  • JavaScript libraries:

    • core-js 3.24.0
    • Reactjs
  • PaaS:

    • Amazon Web Services
    • Reverse proxies
  • Envoy:

    • Cookie compliance
  • Others:

    • OneTrust
    • A/B testing
    • Google Optimize
2024-07-22 06:20:48

前端是用 FLEX 编写的,请在您的 Mac 或 Windows 计算机上查看源代码。 你会看到很多flex文件格式的xml文件。

当然,与服务器的连接和平台集成可能是用 C++ 本机编写的。 但UI部分只是FLEX...

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...

我要还你自由 2024-07-22 06:20:47

从这里:http://www.quora。 com/Spotify-desktop-app 背后的技术是什么
日期:2014-09-09

Andreas Blixt,在 Spotify 工作了 5 年的员工:

我们所有客户的核心都是 C++,但自从 Rasmus 的
帖子得到了压缩,功能被分成了模块。 作为
Spotify 在越来越多的平台上可用
获得更丰富的功能集,我们需要确保“核心”不会
成为“凡事都一点点”。 这意味着突破
某些功能(例如播放控制)独立存在
模块。 这些模块仍然是 C++,但足够独立
他们的逻辑理论上可以在其他地方实现
语言。 我们将这些模块的接口层称为“Cosmos”,并且
它的工作方式与 HTTP 并没有太大不同。 Cosmos让任何部分
客户端使用任意路径与模块通信,并且
有效负载,允许更灵活的架构。 一些明显的
好处是版本化接口(例如:GET sp://player/v1/main
返回玩家状态)和用于传递数据的 JSON。 这是
对于我们桌面客户端的另一项更改很重要。

现在我们的很多桌面 UI 实际上都在使用 Chromium Embedded
框架(CEF),这基本上意味着我们的观点由
JavaScript、HTML 和 CSS。 让我们所有的功能团队能够
致力于他们的特色,而不用担心破坏别人的观点,
每个视图都在自己的“浏览器”中沙箱化(我想你可以认为
Chrome 中的视图作为选项卡,除了我们一次显示多个视图
时间)。 但这也带来了一个限制:共享数据
视图之间变得更加困难。 这就是 Cosmos 发挥作用的地方
真正简化了核心 (C++) 和 JavaScript 之间的通信
land:JS 客户端可以发出任意请求,如果有
绑定,该请求得到处理和响应。 一个例子是
“messages”端点允许任何视图将 JSON 数据推送到任何
其他正在监听的视图(有点像 HTML5 中的 window.postMessage,
除了这个还可以与 C++ 模块交互)。 这也是如何
客户端中的所有播放按钮都知道曲目是否正在播放或
不,或者是否可以离线使用(另一个 Cosmos 模块),或者
您是否已将歌曲保存到您的音乐中。

我们技术堆栈的另一个重要变化是我们已经迁移
一些逻辑进一步“返回”,进入视图聚合服务。 那么我们在哪里
之前会在客户端中执行几乎所有逻辑,仅使用
后端作为数据存储,我们现在在逻辑层做了更多的工作
在数据存储和客户端之间,暴露端点非常
与 Cosmos 类似(事实上,您可以以完全相同的方式调用后端
您称为 Cosmos 模块,因此在层之间移动并不麻烦)。
这样做的原因有两个:一是它让我们能够扩展到更多
平台速度更快,因为需要实现的客户端逻辑更少
第二,它确实有助于我们保持客户行为更加一致
并且是最新的,因为客户更“愚蠢”。 为了减轻任何
可能由此带来的放缓我们已经确保有
所有数据的缓存规则,这样客户端仍然会保留数据
在本地,它只是不负责那么多的业务逻辑
曾经是。

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.

若有似无的小暗淡 2024-07-22 06:20:47

以下是他们使用的第三方组件的列表(当然是在 C++ 之上):

  • Boost
  • Expat
  • FastDelegate
  • giflib
  • libjpeg
  • libogg
  • libvorbis
  • Mersenne Twister
  • zlib
  • NSIS(仅限 Windows)
  • Windows 模板库(仅限 Windows)
  • Growl(仅限 Max OS X)
  • MATrackingArea (仅限 Mac OS X)

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)
不可一世的女人 2024-07-22 06:20:47

根据 Spotify 设计师的说法:

http://twitter.com/#!/tobiasahlin/status/96483609799692288

“其中一些是用 C++ 编写的,另一些是用一种名为 Spider 的 HTML 标记语言编写的”
“它专为在 Spotify 内使用而设计”

According to a Spotify designer:

http://twitter.com/#!/tobiasahlin/status/96483609799692288

"Some of it is in C++, and some of it is in a HTML-ish markup language called Spider"
"It's built solely to be used within Spotify"

海的爱人是光 2024-07-22 06:20:47

Spotify 现在使用 Chromium 嵌入式框架 (CEF) 在桌面内显示由 HTML/CSS/JavaScript 组成的网络界面应用。

Spotify now uses the Chromium Embedded Framework (CEF) to display a web interface consisting of HTML/CSS/JavaScript within the desktop application.

各空 2024-07-22 06:20:47

这个答案是更新的,来自他们的工程博客:https://engineering.atspotify.com/2021/04/07/building-the-future-of-our-desktop-apps/

Spotify 桌面客户端是 Windows 和 Mac 本机应用程序,它使用 CEF(Chromium 嵌入式框架)来显示基于 Web 的用户界面。 今天仍然如此,但对于以前版本的 Desktop,客户端中的每个“页面”都是作为独立的“应用程序”构建的,以便在其自己的 iframe 中运行。

但是,他们最近必须更新其架构,因为他们希望集成使用 React 构建的 Web Player桌面客户端,以便单个团队可以开发和发布功能两个客户。

最终的架构看起来像一层平台 API,向客户端公开底层 Spotify 生态系统,具有基于 React 的用户界面和通过 React Hooks 公开的平台 API。 因此,新的 UI 可以在 Web 上运行,也可以在我们的桌面容器中运行,并且永远不会知道或关心数据是否来自我们的 C++ 堆栈或 Web 基础设施。

架构图

This answer is more updated and coming from their engineering blog: https://engineering.atspotify.com/2021/04/07/building-the-future-of-our-desktop-apps/

The Spotify Desktop client is a Windows and Mac native application that uses CEF (Chromium Embedded Framework) to display a web-based user interface. That’s still true today, but for the previous version of Desktop, every “page” in the client was built as a standalone “app” to run inside its own iframe.

However, they recently had to update their architecture because they wanted to integrate their Web Player built with React and Desktop Client in a way that a single team can develop and ship features for both clients.

The final architecture looks like a layer of Platform APIs that expose the underlying Spotify ecosystem to clients, with a React-based user interface and the Platform APIs exposed via React Hooks. Thus, the new UI can run on the web, and it can run in our Desktop container, and never know, or care, if the data is coming from our C++ stack or our web infrastructure.

Architecture Diagram

风柔一江水 2024-07-22 06:20:47

从他们的网站

Spotify 主要使用 Python 和 C++ 构建

From their website:

Spotify is built mostly in Python and C++

桃酥萝莉 2024-07-22 06:20:47

鉴于它在 Windows 上运行,显然不是 .NET(进程资源管理器告诉我这一点),没有遵循 AIR 安装过程,我想说的是使用跨平台库的 C++。

所有内容都被编译成一个可执行文件,这表明他们可以访问所有依赖项的源。

对于 Techno 来说……我认为他们使用了 Hardhouse Electronica

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

彩扇题诗 2024-07-22 06:20:47

在这里检查第一个答案:
https://www.quora. com/What-is-the-technology-stack-behind-the-Spotify-web-client

Spotify 前技术主管 Andreas Blixt 对此进行了详细解答。

我们有一个处理登录(以及其他一些
服务器端逻辑)以及为不同域上的应用程序提供服务(例如
安全原因)。 其余的都是 JavaScript。

为了让 JavaScript 与后端通信,它通过
我们所说的“接入点”(AP),一种高度优化的 C++ 服务
它可以同时处理大量活动连接。 这项服务是
负责将请求路由到正确的后端服务。 这
服务能够在端口 80 和 443 上运行,以克服
防火墙限制。 通信是通过 WebSocket 完成的(或
Flash 适用于某些浏览器)。

为了与特定后端服务通信,我们路由请求
使用我们自己的称为“Hermes”的传输方式通过 AP。 这是
基本上是一个 URL 方案,让 AP 知道将数据发送到哪里
要求。 有效负载被编码为 Protobuf。 Hermes 有很好的缓存
系统(我们称之为“Mercury”)将结果存储到 IndexedDB
支持它的浏览器(我们在桌面上有相同的系统
客户端,而是用 C++ 实现),以避免请求相同的
数据两次。 这对于重新请求的资源非常有用
很多,例如艺术家、专辑和曲目。

对于 UI,我们编写了一个非常先进的应用程序框架
(称为“Stitch”)允许开发每个视图
由不同团队独立进行,无需担心
打破任何东西。 视图在沙盒中运行,但可以
仍然依赖共享库来完成常见的事情,例如加载
跟踪元数据等。截至撰写本文时,我们有大约 35 个独特的视图(或
应用程序)在网络播放器中。

视图通过我们所说的“桥”获取数据并执行操作
(基本上,一个 API)使用 postMessage,这样我们就不需要
重新初始化每个应用程序的所有通用代码。 真正酷的事情
关于这一点是,我之前提到的大约 35 个视图中的很多都可以
实际上也无需修改即可在桌面客户端内运行。 的
当然,他们将使用 Chromium 的钩子来代替 postMessage
嵌入式框架和我们的 C++ 核心。

我们尝试尽可能多地使用 HTML 5 技术,但在某些方面
情况取决于 Flash。 我认为我们有一个非常酷的技术堆栈
我们一般的网络播放器。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文