【问题标题】:How to play custom index in JWPlayer Playlist?如何在 JWPlayer 播放列表中播放自定义索引?
【发布时间】:2019-05-14 07:12:44
【问题描述】:
我已尝试加载播放列表(例如config.playlist = arrPlaylist),它对我有用,
但是当我尝试从我的播放列表中播放 customIndex 时,它只能从 startIndex 播放
注意:我还添加了(playerJW.playlistIndex = iCurrentPlaylistIndex)
但不工作
【问题讨论】:
标签:
ios
jwplayer
playlist
【解决方案1】:
假设您在下面有 JWPlayerController 和 UITableView 或 UICollectionView。 (类似 YouTube 的观点)
var player: JWPlayerController!
所以只需在 UITableView 或 UICollectionView 中加载您的视频对象(数组)。
在 didSelectedIndix 上只需应用 player.stop 并再次设置文件并播放。
config.file = "https://URL...."
player = JWPlayerController.init(config: config)
player.play()