Skip to content

Downcast

Downcast 是一款适用于 iOS、Mac、Apple Watch 和 CarPlay 的播客应用。Protocol Launcher 允许您生成官方 URL scheme 链接,在 Downcast 中导入播客 feed 订阅。

使用方式

有两种使用此库的方式:

  • 按需导入(On-Demand):从子路径导入支持 tree-shaking,保持较小的打包体积。
  • 完整导入(Full Import):从根包导入更方便,但会包含所有应用模块。

生产构建建议选择按需导入;快速脚本或演示可以使用完整导入。

选择安装方式

按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。

说明

Downcast 官方知识库文档列出了 itpc://podcast://feed://downcast:// 作为受支持的播客 feed URL scheme。打开这些 URL 时,Downcast 会尝试为该 URL 指向的播客导入订阅。

subscribe() 需要传入一个已经使用上述官方 scheme 的完整 URL。subscribeFeedUrl() 返回官方给 Chrome RSS Subscription Extension 的原样模板:downcast://feed-url=%s

Downcast Scheme

On-Demand
ts
import { open } from 'protocol-launcher/downcast'

const url = open()

使用 Feed Scheme 订阅

On-Demand
ts
import { subscribe } from 'protocol-launcher/downcast'

const url = subscribe({
  url: 'itpc://example.com/podcast/rss',
})

Chrome RSS Extension 模板

On-Demand
ts
import { subscribeFeedUrl } from 'protocol-launcher/downcast'

const url = subscribeFeedUrl()
ts
subscribeFeedUrl()
// => 'downcast://feed-url=%s'

官方文档