I have a video button. When i press my button, i am trying to play youtube video, my program is working on portrait mode but when only playing video i want to change portrait mode to landscape mode.
Here is my code;
- (void) playVideo
{
UIView *YoutubeView = [[UIView alloc] initWithFrame:CGRectMake(10, 80, 300, 225)];
YoutubeView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
YoutubeView.clipsToBounds = YES;
YoutubeView.layer.cornerRadius = 10.0;
NSString *urlString = [videoButtons objectAtIndex:pageIndex];
NSLog(@"URLSTRING = %@",urlString);
NSURLRequest *requestURL = [[NSURLRequest alloc]initWithURL:[NSURL URLWithString:urlString]];
UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 500, 500)];
[webView loadRequest:requestURL];
[YoutubeView addSubview:webView];
[self addSubview:YoutubeView];
}
In this code i am creating webview
for playing video,
I have one more question. When i press my button youtube is coming up on webview
, than i press youtube, playing video. But i want to press button, i want to go to playing video part directly.
What i need to do for these questions?
Thanks for your answers and interest.Sorry my bad english :).