I have embedded videos (pulled from YouTube API v3) into my iPhone app using a UIWebView as suggested. The problem is that some videos, such as those from VEVO, produce the fol
Using YouTube's YTPlayerView for iOS and setting the origin
property to a valid URL allows many VEVO videos to be played properly.
In your View Controller:
@property (weak, nonatomic) IBOutlet YTPlayerView *playerView;
// ..
NSDictionary *playerVars = @{
@"playsinline" : @1,
@"showinfo" : @0,
@"rel" : @0,
@"controls" : @1,
@"origin" : @"https://www.example.com", // this is critical
@"modestbranding" : @1
};
[self.playerView loadWithVideoId:@"Ri7-vnrJD3k" playerVars:playerVars];
With origin
:
Without origin
: