How to embed a video from my YouTube channel to an app in iOS ?
I followed this guide of YouTube Developers , but the video does not appear on the screen.
My code looks like this:
FirstViewController.h
//
// FirstViewController.h
// GaleRio
//
// Created by Alex on 25/11/14.
// Copyright (c) 2014 Creapix Tecnologia Criativa. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YTPlayerView.h"
@interface FirstViewController : UIViewController
@property(nonatomic, strong) IBOutlet YTPlayerView *playerView;
@end
FirstViewController.m
//FirstViewController.m
// GaleRio
//
// Created by Alex on 25/11/14.
// Copyright (c) 2014 Creapix Tecnologia Criativa. All rights reserved.
//
#import "FirstViewController.h"
@interface FirstViewController ()
@end
@implementation FirstViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self.playerView loadWithVideoId:@"M7lc1UVf-VE"];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
The links in the storyboard were made correctly, I think the problem is in the ID of the video on youtube.
EDIT: I've tried solution from Lucas did not go any further.
Note: code available in full here .