-
Notifications
You must be signed in to change notification settings - Fork 0
/
VideoDetailsController.m
63 lines (47 loc) · 1.72 KB
/
VideoDetailsController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#import "VideoDetailsController.h"
#import "TiVoHTTPClient.h"
#include <syslog.h>
#include <dlfcn.h>
#import <UIKit/UIKit.h>
@implementation VideoDetailsController
{
}
-(void)loadView
{
self.view = [[[UIScrollView alloc] initWithFrame: [[UIScreen mainScreen] bounds]] autorelease];
self.view.backgroundColor = [UIColor whiteColor];
self.title = @"Video";
//NSString *date = [[NSDate dateWithTimeIntervalSince1970:
// [video->captureDate doubleValue]] descriptionWithCalendarFormat:
// @"%m/%d/%y %H:%M" timeZone:nil locale:nil];
html = [NSString stringWithFormat:
@"<html><center><h2>%@</h2></center> \
<b>Duration: </b>%d Minutes<br><br> \
<b>Date: </b>%@<br><br> \
<b>Description: </b>%@<br><br> \
</html>",
(video->episodeTitle == nil ? video->title : video->episodeTitle),
[(video->duration) intValue]/(1000*60), video->captureDate,
video->description
];
htmlView = [[UIWebView alloc] initWithFrame:CGRectMake(10,10,290,460)];
htmlView.backgroundColor = [UIColor whiteColor];
[htmlView loadHTMLString: html baseURL:nil];
//[htmlView loadRequest:[NSURLRequest requestWithURL:
// [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"VideoDetails"
// ofType:@"html"] isDirectory:NO]]];
[self.view addSubview: htmlView];
}
-(void)viewDidLoad
{
downloadBtn = [[[UIBarButtonItem alloc] initWithTitle:@"Download" style:UIBarButtonItemStyleBordered target:self action:@selector(download:)] autorelease];
self.navigationItem.rightBarButtonItem = downloadBtn;
}
-(void)download: (id)sender
{
}
-(void)setTiVoItem: (TiVoItem*)i
{
video = i;
}
@end