1

YTSwiftyPlayer在自定义中使用过UICollectionViewCell。当我在单元格中播放带有视频 ID 的 youtube 视频时,它会全屏播放。

var parameters = ["width": 
                  "100%",
                  "height": "100%",
                  "webkit-playsinline":1,
                  "playsinline":1,
                  "autoplay":1,
                  "modestbranding":1,
                  "rel":"0",
                  "controls":"1",
                  "fs":"0",
                  "allowfullscreen":"1",
                  "enablejsapi":"1",
                  "iv_load_policy":"3",
                  "showinfo":0] as [String : Any]

let youtubeID = "M7lc1UVf-VE"
cell.youtubePlayer.setPlayerParameters([.videoID(youtubeID),.showInfo(false),.showModestbranding(false),.showRelatedVideo(false),.playsInline(true),.autoplay(true)])
cell.youtubePlayer.loadPlayer()
cell.youtubePlayer.playVideo()

我想在单元格内播放 youtube 视频,而不是全屏

4

0 回答 0