2
How to embed a video from my Youtube to an app in iOS?
Follow this guide of Youtube Developers, but the video does not appear on the screen.
Man code is 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 ID video on youtube.
EDIT: I tried to solution of Lucas but it didn’t help.
Note: code available in full here.
the link between your Iboutlet and the class is well made?
– DaSilva
The solution proposed by me did not work?
– fpg1503