测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可协议 | MIT |
发布最后发布 | 2018年3月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Carlos Corvaia 维护。
依赖 | |
Alamofire | >= 0 |
SwiftyJSON | >= 0 |
lf | >= 0 |
// Using Vidyard Identity Manager to get a Swiftyard instance
VidyardLoginManager.login(username: "[email protected]", password: "supersecretpassword",
completion: { (sessionCookie) in
// Use this object for all communication with vidyard assets
let swiftYard = Swiftyard.init(cookie: sessionCookie)
}, error: { (error) in
// Login failed, good idea to show an alert etc
let alertController = UIAlertController(title: "Login Failed", message: "Please check your email / password and try again", preferredStyle: UIAlertControllerStyle.alert)
alertController.addAction(UIAlertAction(title: "Okay", style: UIAlertActionStyle.default,handler: nil))
self.show(alertController, sender: self)
}
)
let swiftYard = Swiftyard.init(token: "abc123") // Retrieved from the Vidyard dashboard
let players = [VidyardPlayer]
swiftYard?.getPlayers(page: 1, perPage: 20, order: "created_at", direction: "asc", query: "") { vidyardPlayers in
players.append(vidyardPlayers)
self.tableView.reloadData()
}
存储播放器以供离线观看
player.store {
print("Player has stored all videos and splash screens for offline use")
}
获取离线播放器列表
var offlinePlayers = [VidyardPlayer]()
swiftYard.getOfflinePlayers { (offlineVYPlayers) in
offlinePlayers = offlineVYPlayers
}
同步离线时捕获的观看分析数据
swiftYard.syncAnalytics()
要运行示例项目,克隆仓库,然后从您想要运行的项目目录中运行 pod install
命令。
Carlos Corvaia, [email protected]
Thomas Morrison, [email protected]
Swiftyard 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。