I am using appcelerator to make apps for iOS, I am stuck in this situation like previously I was using webview to play youtube videos but now some videos are not playing.
I tried much in webview but no success. So I code in objective C and it was working in native. Then I tried to make module for it, so no success.
Can any one help me to make module or else make it work using hyperloop. Below is my code in objective which is working:-
UIWebView *videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
videoView.backgroundColor = [UIColor clearColor];
videoView.opaque = NO;
videoView.delegate = self;
NSString *videoUrl = @"http://www.youtube.com/v/1MjC30zo1KA";
NSString *htmlString = [NSString stringWithFormat:@"\
<html>\
<head>\
<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/>\
</head>\
<body style=\"background:#FFF;margin-top:0px;margin-left:0px\"><div><object width=\"320\" height=\"180\"><param name=\"movie\" value=\"%@\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"%@\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"180\"></embed></object></div></body></html>",videoUrl,videoUrl];
[videoView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.youtube.com"]];
This code works like charm, but after making module app crash for below line:-
UIWebView *videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
Help me out in this situation, Thanks in advance.