Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/joehewitt/three20
Browse files Browse the repository at this point in the history
  • Loading branch information
dhou committed Apr 3, 2009
2 parents 6760c09 + 98fc629 commit 1192212
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/TTURLRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ - (void)dealloc {
[_httpBody release];
[_parameters release];
[_contentType release];
[_delegates release];
[_response release];
[_timestamp release];
[_cacheKey release];
Expand Down
6 changes: 3 additions & 3 deletions src/TTURLRequestQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,19 @@ - (void)load:(NSURL*)url {
- (BOOL)cancel:(TTURLRequest*)request {
NSUInteger index = [_requests indexOfObject:request];
if (index != NSNotFound) {
[_requests removeObjectAtIndex:index];

request.isLoading = NO;

for (id<TTURLRequestDelegate> delegate in request.delegates) {
if ([delegate respondsToSelector:@selector(requestDidCancelLoad:)]) {
[delegate requestDidCancelLoad:request];
}
}

[_requests removeObjectAtIndex:index];
}
if (![_requests count]) {
[_queue performSelector:@selector(loaderDidCancel:wasLoading:) withObject:self
withObject:(id)!!_connection];
withObject:(id)!!_connection];
if (_connection) {
TTNetworkRequestStopped();
[_connection cancel];
Expand Down
25 changes: 18 additions & 7 deletions src/TTYouTubeView.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@
static CGFloat kDefaultWidth = 140;
static CGFloat kDefaultHeight = 105;

static NSString* kEmbedHTML = @"<html><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
static NSString* kEmbedHTML = @"\
<html>\
<head>\
<meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no, width=%0.0f\"/>\
</head>\
<body style=\"background:#fff;margin-top:0px;margin-left:0px\">\
<div><object width=\"%0.0f\" height=\"%0.0f\">\
<param name=\"movie\" value=\"%@\"></param><param name=\"wmode\"\
value=\"transparent\"></param>\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\"\
wmode=\"transparent\" width=\"%0.0f\" height=\"%0.0f\"></embed>\
</object></div>\
</body>\
</html>";

///////////////////////////////////////////////////////////////////////////////////////////////////

Expand All @@ -32,8 +42,8 @@ - (void)dealloc {
// UIView

- (void)layoutSubviews {
[self stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:
@"yt.width = %0.0f; yt.height = %0.0f", self.width, self.height]];
[self stringByEvaluatingJavaScriptFromString:
[NSString stringWithFormat:@"yt.width = %0.0f; yt.height = %0.0f", self.width, self.height]];
}

///////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -43,7 +53,8 @@ - (void)setUrl:(NSString*)url {
_url = [url copy];

if (_url) {
NSString* html = [NSString stringWithFormat:kEmbedHTML, _url, self.width, self.height];
NSString* html = [NSString stringWithFormat:kEmbedHTML, self.width, self.width,
self.height, _url, _url, self.width, self.height];
[self loadHTMLString:html baseURL:nil];
} else {
[self loadHTMLString:@"&nbsp;" baseURL:nil];
Expand Down

0 comments on commit 1192212

Please sign in to comment.