youtube-ios-player-helper
youtube-ios-player-helper copied to clipboard
'-[YTPlayerView playerState]: unrecognized selector sent to instance 0x7f98617bdc60'
reason: '-[YTPlayerView playerState]: unrecognized selector sent to instance 0x7f98617bdc60'
Getting the below error and unable to play the video in iOS
YTPlayerView* videosWebView;
YTPlayerState playerState = videosWebView.delegate;
player state is empty
Hi @nihp ,
The code snippet seems incorrect to me, specifically YTPlayerState playerState = videosWebView.delegate;
This wouldn't work because delegate is an instance of YTPlayerViewDelegate.
You should be using the playerState
(playerState) method instead.
How can I add this and return the state. It would be helpful.
isPlaying = [videosWebView playerState] == kYTPlayerStatePlaying;
How can I handle the above with the completion handler. I am new to this,