BaiduFM-Swift

August 11, 2026 · View on GitHub

Language: English | 中文

A Baidu FM client modernized for Swift 6.2, Swift Package Manager, and iOS 15 or later. The UI supports English and Simplified Chinese; English is the development and fallback language.

Build

  1. Install an Xcode release that includes Swift 6.2 or later.
  2. Open BaiduFM.xcodeproj in Xcode and select the shared BaiduFMApp scheme.
  3. Set BAIDUFM_API_BASE_URL in Configuration/Shared.xcconfig to an authorized HTTPS content service.
  4. Select an iOS Simulator or connected device and run the app.

Command-line core validation is also available with swift build. A complete iOS build requires Xcode because the app uses UIKit, AVFoundation, storyboards, and asset catalogs.

The historical Baidu FM endpoint is retained only as a development default and may be unavailable. Production distribution requires explicit authorization for the API, streams, artwork, lyrics, trademarks, and downloads. See the release checklist.

API Disclaimer

  • This repository is a development sample that references a historical, non-public Baidu FM API. It must not be distributed with third-party content, branding, streaming, or download access without explicit authorization from the relevant rights holders and service provider.

Features

  • Download songs to local storage (with delete functionality)
  • Favorite music management (add/remove favorites)
  • Recently played music history (with clear functionality)
  • Pull-to-refresh and load more songs
  • Auto-scrolling lyrics
  • Real-time playback progress display
  • Play/pause control
  • Previous/next track navigation
  • Music category browsing
  • Categorized song lists
  • Background playback support
  • Lock screen album artwork and song info display
  • Lock screen music controls (next/previous, play/pause)
  • Favorites list, recently played list, and downloaded songs list

Screenshots

  • Apple Watch Home Screenshot 0

  • Apple Watch Menu Screenshot 0

  • Apple Watch Song List Screenshot 0

  • Apple Watch Category Selection Screenshot 0

  • iPhone Lock Screen Display & Controls Screenshot 0

  • iPhone Home Screen Screenshot 1

  • iPhone Music Categories Screenshot 2

  • iPhone Song List Screenshot 3

Third-Party Libraries

Swift Concepts Used

  • Network requests
  • JSON parsing
  • Swift regular expressions
  • Swift singleton pattern
  • Pull-to-refresh & load more with MJRefresh
  • Song progress with UIProgressView
  • Lyrics scrolling with UITextView
  • Closures
  • Property observers (get, set, didSet)
  • Streaming audio playback using AVPlayer
  • Typed NotificationCenter names for data passing

TODO Features

  • Improve API resilience when Baidu changes its private endpoints

Contact

Powered by DartNode