PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/filesystems-objc/Support/YTVideo.h

http://macfuse.googlecode.com/
C++ Header | 48 lines | 11 code | 7 blank | 30 comment | 0 complexity | 9e2a4af2d54b34bee977b37ccd49e39d MD5 | raw file
 1// ================================================================
 2// Copyright (C) 2008 Google Inc.
 3// 
 4// Licensed under the Apache License, Version 2.0 (the "License");
 5// you may not use this file except in compliance with the License.
 6// You may obtain a copy of the License at
 7// 
 8//      http://www.apache.org/licenses/LICENSE-2.0
 9// 
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15// ================================================================
16//
17//  YTVideo.h
18//  YTFS
19//
20//  Created by ted on 12/11/08.
21//
22#import <Foundation/Foundation.h>
23
24// NOTE: This is a very simple class that can fetch an xml feed of videos from
25// YouTube and parse it into YTVideo objects. This is meant to be light 
26// and simple for learning purposes; a real project should use the full-featured
27// GData Objective-C API: http://code.google.com/p/gdata-objectivec-client/
28@interface YTVideo : NSObject {
29  NSXMLNode* xmlNode_;
30}
31
32// Returns a dictionary keyed by filename-safe video name of the top rated
33// videos on YouTube. The vales are YTVideo*.
34+ (NSDictionary *)fetchTopRatedVideos;
35
36+ (id)videoWithXMLNode:(NSXMLNode *)node;
37- (id)initWithXMLNode:(NSXMLNode *)node;
38
39// Returns the URL to the thumbnail image for the video.
40- (NSURL *)thumbnailURL;
41
42// Returns the URL that will play the video in a web browser.
43- (NSURL *)playerURL;
44
45// Returns NSData for the xml string for this video node in pretty-print format.
46- (NSData *)xmlData;
47
48@end