/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. // NOTE: This is a very simple class that can fetch an xml feed of videos from
  24. // YouTube and parse it into YTVideo objects. This is meant to be light
  25. // and simple for learning purposes; a real project should use the full-featured
  26. // GData Objective-C API: http://code.google.com/p/gdata-objectivec-client/
  27. @interface YTVideo : NSObject {
  28. NSXMLNode* xmlNode_;
  29. }
  30. // Returns a dictionary keyed by filename-safe video name of the top rated
  31. // videos on YouTube. The vales are YTVideo*.
  32. + (NSDictionary *)fetchTopRatedVideos;
  33. + (id)videoWithXMLNode:(NSXMLNode *)node;
  34. - (id)initWithXMLNode:(NSXMLNode *)node;
  35. // Returns the URL to the thumbnail image for the video.
  36. - (NSURL *)thumbnailURL;
  37. // Returns the URL that will play the video in a web browser.
  38. - (NSURL *)playerURL;
  39. // Returns NSData for the xml string for this video node in pretty-print format.
  40. - (NSData *)xmlData;
  41. @end