LBYouTube

44 views
Skip to first unread message

Bill Frowine, PMP

unread,
Aug 20, 2013, 6:24:08 PM8/20/13
to pdx-cocoa...@googlegroups.com
Hi:

Hello:

Has anyone used the LBYouTube Custom Control?  I have implemented it using the following where I call it from my ViewController rather than in their example project that loads it using the AppDelgate.  

Here is my code in the view controller:

#import "ViewController.h"
#import "LBYouTube.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
  /*  LBYouTubePlayerViewController* controller = [[LBYouTubePlayerViewController alloc] initWithYouTubeURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=-MLbC3er2Fc"] quality:LBYouTubeVideoQualityLarge];
    controller.delegate = self;
    controller.view.frame = CGRectMake(0.0f, 0.0f, 300.0f, 400.0f);
    controller.view.center = self.view.center;
    [self.view addSubview:controller.view];
*/
    LBYouTubePlayerViewController* controller = [[LBYouTubePlayerViewController alloc] initWithYouTubeURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=-MLbC3er2Fc&list=FLEYfH4kbq85W_CiOTuSjf8w&feature=mh_lolz"] quality:LBYouTubeVideoQualityLarge];
    controller.delegate = self;

    

    self.view = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.view addSubview:controller.view];

    

}

Thanks!

Janine Ohmer

unread,
Aug 20, 2013, 6:43:39 PM8/20/13
to pdx-cocoa...@googlegroups.com
I have not used it but I'm going to hazard a guess that you need to set controller's frame size.  If that doesn't fix it you'll need to tell us what's failing.

janine

--
You received this message because you are subscribed to the Google Groups "pdx-cocoaheads-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdx-cocoaheads-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Steven W Riggins

unread,
Aug 20, 2013, 6:53:21 PM8/20/13
to pdx-cocoa...@googlegroups.com
If you are going to embed another viewController's view this way, then you need to a) support iOS 5 and later and b) make the appropriate calls to keep the viewcontroller hierarchy correct (which is not the view hierarchy)

see:


On Aug 20, 2013, at 3:24 PM, "Bill Frowine, PMP" <wfro...@gmail.com> wrote:

Bill Frowine, PMP

unread,
Aug 20, 2013, 8:50:33 PM8/20/13
to pdx-cocoa...@googlegroups.com
Hi Steven:

Here is a project with code.  I am not understanding on what I should be instead of add subview.

Do you mind taking a look and letting me know where I am going wrong?

Goalball Test.zip
Reply all
Reply to author
Forward
0 new messages