目录
目录README.md

M3UKit

action

M3UKit is an easy way of parsing of extended M3U playlists.

Content

Supported directives

Directive Description Example
#EXTM3U file header, must be the first line of the file #EXTM3U
#EXTINF: track information: runtime in seconds and display title of the following resource / additional properties as key-value pairs #EXTINF:123,Artist Name – Track Title
artist - title.mp3
#EXTGRP: begin named grouping #EXTGRP:Foreign Channels

Go to content

Installation

Swift Package Manager

To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter M3UKit repository URL:

https://github.com/SwiftExtensions/M3UKit.git

You can also navigate to your target’s General pane, and in the Frameworks, Libraries, and Embedded Content section, click the + button, select Add Other, and choose Add Package Dependency.

For more information, see Adding Package Dependencies to Your App.

Go to content

CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. To integrate M3UKit into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'M3UKit', git: 'https://github.com/SwiftExtensions/M3UKit.git'

Go to content

Parsing

import M3UKit

let parser = M3UParser()
let playlist = parser.parse(string: PLAYLIST)

Go to content

Loading from newtwork

import M3UKit

let loader = M3ULoader()
try? loader.load(with: URL_TO_PLAYLIST) { response in
    switch response {
    case let .success(playlist):
        print(playlist)
    case let .failure(error):
        print(error)
    }
}

Go to content

关于
207.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号