View Single Post
  #9  
Old 19th March 2012, 16:34
thbsousa thbsousa is offline
Junior Member
 
Join Date: Mar 2012
Posts: 1
Default Thiago

I'm not getting, what is wrong?

- (void)embedStream
{
NSString* embedHTML = @"\
<html><head>\
<style type='text/css'>\
body {\
background-color: transparent;\
color: white;\
}\
</style>\
</head><body style='margin:0'>\
<embed id='yt' src='%@' type='application/x-shockwave-flash' width='%0.0f' height='%0.0f' autoplay='true'></embed>\
</body></html>";

CGRect frame;
frame.size.width=320;
frame.size.height=155;
frame.origin.x=0;
frame.origin.y=0;

link = [link stringByReplacingOccurrencesOfString:@" " withString:@""];
NSString *parametro = link;
NSString *encoding = [parametro stringByAddingPercentEscapesUsingEncoding:NSUTF8St ringEncoding];
NSString *url = [NSString stringWithFormat:@"http://xthbsousax.is.livestream-api.com/livestreamiphone/thbsousa/playlist.m3u8", encoding];
NSString *html = [NSString stringWithFormat:embedHTML,url, frame.size.width, frame.size.height];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:[NSURL URLWithString:nil]];
[self.view addSubview:videoView];
NSLog(@"%@",html);
}
Reply With Quote