如何告诉播放器视图控制器播放要播放的歌曲列表视图中的歌曲?

问题描述 投票:0回答:1

[在PlayerViewController中,我试图播放从“表”视图中选择的歌曲。有什么更好的方式编写player.playStream行?

 player.playStream(fileUrl: "http://localhost/musicfiles" + Song[IndexPath].getName())

我看到一条错误消息:'Song.Type'类型的值没有下标

swift
1个回答
0
投票

尝试一下!

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    player.playStream(fileUrl: "http://localhost/musicfiles" + Song[indexPath.row].getName())
}
© www.soinside.com 2019 - 2024. All rights reserved.