Friday 17 May 2013

Is it possible to play the number of youtube urls one by one continuously on youtube in iOS?



I have the 5 videos for single product.So,I stored the 5 url's in an array for playing on you tube ,
And loading the urls using array index .
But  only last URL is playing on youtube .How can I Play the all urls one by one on youtube continuously?



for (int i = 0; i<[arrayOfURLs count]; i++)
 {
    NSString *strForvideo = [arrayOfURLs objectAtIndex:i];
    strForvideo = [strForvideo stringByReplacingOccurrencesOfString:@"http://youtu.be/" withString:@""];
    NSLog(@"temp str %@",strForvideo);
    NSMutableString * htmlCode = [NSMutableString stringWithString:@"<html><body><iframe frameborder=\"0\" width=\"450\" height=\"240\" src=\"http://www.youtube.com/embed/"];
    [htmlCode appendString:strForvideo];
    [htmlCode appendString:@"\""];
    [htmlCode appendString:@"</iframe></body></html>"];
     NSLog(@"YOU TUBE:%@",htmlCode);
    [self.webviewOverView loadHTMLString:[htmlCode description] baseURL:nil];
}


Please any one suggest me solution for this..


No comments:

Post a Comment