swift - How to proper use YouTube iOS Player Helper? -
i trying load videos/playlists youtube (personal account) using swift. added ytplayerview
class , iframe html file videos not loading.
added uiview in storyboard , changed class ytplayerview , created iboutlet.
here's code:
import uikit import youtube_ios_player_helper class ytviewcontroller: uiviewcontroller, ytplayerviewdelegate { @iboutlet var videoplayer: ytplayerview! override func viewdidload() { let videoid = "https://www.youtube.com/watch?v=m7lc1uvf-ve" videoplayer.loadvideobyurl(videoid, startseconds: 0.0, suggestedquality: .small) videoplayer.playvideo() } }
as far read in documentation takes show video. when run app uiview nothing. how can working?
make sure ytplayerview-iframe-player.html
file has been added project , being copied bundle under "copy bundle resources."
Comments
Post a Comment