Skip to content

Commit

Permalink
implemented embedded WebBrowser for http-CustomUrls
Browse files Browse the repository at this point in the history
  • Loading branch information
boecko committed Oct 18, 2012
1 parent df93d2e commit 59c8f30
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Classes/ListController/ServiceZapListController.m
Expand Up @@ -18,6 +18,8 @@

#import <TableViewCell/BaseTableViewCell.h>

#import "TSMiniWebBrowser.h"

@interface ServiceZapListController()
/*!
@brief Hide action sheet if visible.
Expand Down Expand Up @@ -217,8 +219,23 @@ + (void)openStreamWithViewController:(NSURL *)streamingURL withAction:(zapAction
url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", [stdDefaults stringForKey:kCustomACtion], [streamingURL absoluteURL]]];
break;
}
if(url)
[[UIApplication sharedApplication] openURL:url];
if(url) {
if( [url.scheme isEqualToString:@"http"] || [url.scheme isEqualToString:@"https"] ) {
TSMiniWebBrowser *webBrowser = [[TSMiniWebBrowser alloc] initWithUrl:url];

webBrowser.showURLStringOnActionSheetTitle = NO;
webBrowser.showPageTitleOnTitleBar = YES;
webBrowser.showActionButton = YES;
webBrowser.showReloadButton = YES;
webBrowser.mode = TSMiniWebBrowserModeModal;
webBrowser.barStyle = UIBarStyleBlack;

[vc presentModalViewController:webBrowser animated:YES];
}
else {
[[UIApplication sharedApplication] openURL:url];
}
}
}

- (id)init
Expand Down

0 comments on commit 59c8f30

Please sign in to comment.