using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; using System.ServiceModel.Web; namespace DevelopOne.Truveo { /// /// Video is defined within the 'http://xml.searchvideo.com' namespace. /// In this sample we only define a video as having a title. /// [DataContract(Namespace = "http://xml.searchvideo.com")] public class Video { /// /// An integer which serves as a unique identifier for the video record. Each returned video will always have a valid id value. /// [DataMember(Name = "id", Order = 1)] public long Id { get; set; } /// /// A string containing the title of the video in this result. Each returned video will always contain a title. /// [DataMember(Name = "title", Order = 2)] public string Title { get; set; } /// /// A string containing the URL which, when be loaded into a browser window, will play the video. Loading this URL into a browser will result in two possible behaviors. For video that plays from an embedded player inside a web page, loading this URL will simply open the web page that contains the embedded video player. For video that plays in a standalone media player, loading this URL will first open the web page which links to the video (also called the 'referrer page') and then open a standalone media player which will play the video. Each returned video will always have a valid videoUrl value. /// [DataMember(Name = "videoUrl", Order = 3)] public string VideoUrl { get; set; } /// /// A string containing the name of the channel associated with this video record. For example, this string might contain a value such as 'CNN', 'ESPN', 'MTV', 'YouTube', etc.. Each returned video will always have a valid channel value. /// [DataMember(Name = "channel", Order = 4)] public string Channel { get; set; } /// /// A string containing the URL for the channel associated with this video record. For example, this string might contain 'http:\www.cnn.com', 'http:\www.espn.com', etc.. Each returned video will always have a valid channelUrl value. /// [DataMember(Name = "channelUrl", Order = 5)] public string ChannelUrl { get; set; } /// /// Private property for parsing and converting the value of the date Found from the XML. /// [DataMember(Name = "dateFound", Order = 6)] private string parseDateFound { get { return DateFound.ToString(); } set { DateFound = Convert.ToDateTime(value); } } /// /// A string representation of the date when this video was first indexed by the Truveo video search engine. The format of this date conforms to the RFC 2822 specification. For example, 'Thu, 21 Dec 2000 16:01:07 +0200' is the typical date format. Each returned video will always have a valid dateFound value. /// public DateTime DateFound { get; set; } /// /// A decimal value between 0 and 1 indicating how closely the text in the submitted query matches the text in this video record. A higher value indicates that the text in this video record is more closely related to the submitted query. /// [DataMember(Name = "textRelevancy", Order = 7)] public int TextRelevancy { get; set; } /// /// A decimal value between 0 and 1 which represents the rank of this video record in the Truveo video search engine. VRank is an aggregate metric that is continuously calculated and assigned to each video record based on factors such as video popularity, recency, quality, etc.. Unless an alternate sorting operator is applied to the search results, the videos returned in response to a request will be ordered by descending vRank value. Each returned video will always have a valid vRank value. /// [DataMember(Name = "vRank", Order = 8)] public decimal VRank { get; set; } /// /// A string containing a text description of the video in this result. When provided, this length of this description is typically one to three sentences. /// [DataMember(Name = "description", Order = 9)] public string Description { get; set; } /// /// A string containing the URL of the web page where a link to the video in this result is located. /// [DataMember(Name = "referrerPageUrl", Order = 10)] public string ReferrerPageUrl { get; set; } /// /// A string containing the names of one or multiple actors associated with the video in this result. When available, this string is typically a comma-separated list of actor names. /// [DataMember(Name = "actor", Order = 11)] public string Actor { get; set; } /// /// A string containing the names of one or multiple directors associated with the video in this result. When available, this string is typically a comma-separated list of director names. /// [DataMember(Name = "director", Order = 12)] public string Director { get; set; } /// /// A string containing the names of one or multiple writers associated with the video in this result. When available, this string is typically a comma-separated list of writer names. /// [DataMember(Name = "writer", Order = 13)] public string Writer { get; set; } /// /// A string containing the names of one or multiple producers associated with the video in this result. This field is commonly used for movie trailers and clips. When available, this string is typically a comma-separated list of director names. /// [DataMember(Name = "producer", Order = 14)] public string Producer { get; set; } /// /// A string containing the name of the musical artist or group associated with the video in this result. This field is typically used for clips such as music videos. /// [DataMember(Name = "artist", Order = 15)] public string Artist { get; set; } /// /// A string containing the name of the musical album associated with the video in this result. This field is typically used for clips such as music videos. /// [DataMember(Name = "album", Order = 16)] public string Album { get; set; } /// /// A string containing the name of the distribution organization, such as 'Warner Brothers' or 'Sony Pictures', associated with the video in this result. /// [DataMember(Name = "distributor", Order = 17)] public string Distributor { get; set; } /// /// A string containing the name of the person or organization responsible for authoring the video associated with this result. /// [DataMember(Name = "author", Order = 18)] public string Author { get; set; } /// /// A string containing any applicable copyright message for the video in this result. /// [DataMember(Name = "copyright", Order = 19)] public string Copyright { get; set; } /// /// A string containing the rating for the video in this result. For example, this field may contain a value such as 'G', 'PG-13', 'TV-MA', etc.. /// [DataMember(Name = "rating", Order = 20)] public string Rating { get; set; } /// /// An integer which represents the duration of the video clip in seconds. /// [DataMember(Name = "runtime", Order = 21)] public int Runtime { get; set; } /// /// A string that contains the category of the video in this result. For example, this field might contain a value such as 'News', 'Sports', 'Movies', etc.. /// [DataMember(Name = "category", Order = 22)] public string Category { get; set; } /// /// A string that contains a comma-delimited list of tags that are used to describe the video in this results. For example, this string might be something like 'funny, jerry seinfeld, TV'. /// [DataMember(Name = "tags", Order = 23)] public string Tags { get; set; } /// /// A string that contains the name of the show associated with the video in this result. For example, this field could contain a value such as 'Welcome Back Kotter', 'Star Trek', 'Scrubs', etc.. This field is typically used for television shows and clips. /// [DataMember(Name = "showName", Order = 24)] public string ShowName { get; set; } /// /// A string that contains the URL which will provide additional information about the show identified in the showName field. /// [DataMember(Name = "showUrl", Order = 25)] public string ShowUrl { get; set; } /// /// A string that contains the episode name associated with the video in this result. For example, for the television show 'Star Trek', an episode name might be 'The Trouble With Tribbles', 'The Enemy Within', etc.. This field is typically used for television shows and clips. /// [DataMember(Name = "episodeName", Order = 26)] public string EpisodeName { get; set; } /// /// A string that contains a numerical value representing the episode number associated with the video in this result. This field is typically used for television shows and clips. /// [DataMember(Name = "episodeNumber", Order = 27)] public string EpisodeNumber { get; set; } /// /// A string that contains a numerical value representing the season number associated with the video in this result. This field is typically used for television shows and clips. /// [DataMember(Name = "seasonNumber", Order = 28)] public string SeasonNumber { get; set; } /// /// A string that contains the name of the country of origin specified for the video in this result. For example, this field might contain a value such as 'United States', 'France', 'Canada', etc.. Generally, country names will correspond with the ISO 3166-1 specification. /// [DataMember(Name = "country", Order = 29)] public string Country { get; set; } /// /// A string that contains the language associated with the video in this result. For example, this field might contain a value such as 'English', 'French', etc.. Generally, language names will correspond with the ISO 639 specification. /// [DataMember(Name = "language", Order = 30)] public string Language { get; set; } /// /// Private property for parsing the date produced to a .NET DateTime represention. /// [DataMember(Name = "dateProduced", Order = 31)] private string parseDateProduced { get { return DateProduced.ToString(); } set { try { DateProduced = Convert.ToDateTime(value); } catch () { //TODO: implement more advanced parsing } } } /// /// A string that describes the date or time period when the video in this result was originally produced. /// public DateTime DateProduced { get; set; } /// /// A string containing the URL which provides more information about how to register to access the video in this result. This field is only populated for video that can be viewed for free but requires each user to register with the host site before the video can be viewed. /// [DataMember(Name = "registerUrl", Order = 32)] public string RegisterUrl { get; set; } /// /// A string containing the URL which provides more information about how to subscribe to access the video in this result. This field is only populated for video which requires users to purchase a subscription before the video can be viewed. /// [DataMember(Name = "subscribeUrl", Order = 33)] public string SubscribeUrl { get; set; } /// /// A string containing the subscription price, as described by the subscribeUrl. For example, this field could contain the value '$10.99', '€5.99', etc.. /// [DataMember(Name = "subscribePrice", Order = 34)] public string SubscribePrice { get; set; } /// /// A string containing the URL which provides more information about how to rent the video in this result. This field is only populated for video that can be rented for a fee. /// [DataMember(Name = "rentUrl", Order = 35)] public string RentUrl { get; set; } /// /// A string containing the rent price, as described by the rentUrl. For example, this field could contain the value '$0.99', '€1.99', etc.. /// [DataMember(Name = "rentPrice", Order = 36)] public string RentPrice { get; set; } /// /// A string containing the URL which provides more information about how to buy the video in this result. This field is only populated for video that can be purchased to own. /// [DataMember(Name = "buyUrl", Order = 37)] public string BuyUrl { get; set; } /// /// A string containing the purchase price, as described by the buyUrl. For example, this field could contain the value '$14.99', '€10.99', etc.. /// [DataMember(Name = "buyPrice", Order = 38)] public string BuyPrice { get; set; } /// /// An boolean indicating if the video in this result is a live stream. /// [DataMember(Name = "live", Order = 39)] public bool Live { get; set; } /// /// An boolean indicating if the video in this result has been featured by a human editor. /// [DataMember(Name = "editorsPick", Order = 40)] public bool EditorsPick { get; set; } /// /// An integer representing the number of times the video in this result has been viewed. /// [DataMember(Name = "viewCount", Order = 41)] public int ViewCount { get; set; } /// /// An integer representing the number of times the video in this result has been selected as a user favorite. /// [DataMember(Name = "favouriteCount", Order = 42)] public int FavouriteCount { get; set; } /// /// A decimal value between 0 and 5 representing the average user rating for the video in this result. /// [DataMember(Name = "userRating", Order = 43)] public decimal UserRating { get; set; } /// /// An integer representing the number of times this video has been rated. /// [DataMember(Name = "userRatingCount", Order = 44)] public int UserRatingCount { get; set; } /// /// A string containing the URL for the thumbnail image associated with the video in this result. While all thumbnails will not necessarily have a consistent height and width, this thumbnail image will typically have a width of 75 pixels. /// [DataMember(Name = "thumbnailUrl", Order = 45)] public string ThumbnailUrl { get; set; } /// /// A string containing the URL for a large-format thumbnail image associated with the video in this result. This thumbnail image will typically have a width of 400 pixels. /// [DataMember(Name = "thumbnailUrlLarge", Order = 46)] public string ThumbnailUrlLarge { get; set; } /// /// A string containing the URL that will play a free preview of the video in this record. This field is typically used for premium video, where the video specified by the videoUrl field can only be viewed after a purchase has been made. /// [DataMember(Name = "previewVideoUrl", Order = 47)] public string PreviewVideoUrl { get; set; } /// /// A string containing the URL that will play a high-definition version of the video in this record. For example, for videos that are available in AOL Hi-Q format, this field will provide the URL that, when loaded in a browser, will begin playing a high-definition version of this video. /// [DataMember(Name = "hiDefVideoUrl", Order = 48)] public string HiDefVideoUrl { get; set; } /// /// A string containing the HTML tag which, when embedded in an existing web page, will display a thumbnail and related information about the video in this result. When this thumbnail is clicked, it will launch the appropriate media player to play the video. /// [DataMember(Name = "videoResultEmbedTag", Order = 49)] public string VideoResultEmbedTag { get; set; } /// /// A boolean indicating whether the video has been marked as adult content. /// [DataMember(Name = "adultFlag", Order = 50)] public bool AdultFlag { get; set; } /// /// A string containing the HTML tag which, when embedded in an existing web page, will display a thumbnail and related information about the video in this result. When this thumbnail is clicked, it will launch the appropriate media player to play the video. /// [DataMember(Name = "videoPlayerEmbedTag", Order = 51)] public string VideoPlayerEmbedTag { get; set; } /// /// A string that describes the quality of the video in this result. For example, the value of this field could be 'excellent', 'good', 'fair' or 'poor'. /// [DataMember(Name = "quality", Order = 52)] public string Quality { get; set; } /// /// A string containing a comma-separated list of the formats supported by the video in this result. For example, for a video that can be played using Windows Media Player, RealPlayer, or QuickTime, the value in this field would be 'win, real, qt'. /// [DataMember(Name = "formats", Order = 53)] public string Formats { get; set; } /// /// A string such as '300 kbps' that describes the bitrate of the video in this result. /// [DataMember(Name = "bitrate", Order = 54)] public string Bitrate { get; set; } /// /// An integer representing the value in pixels for the width of the video in this result. /// [DataMember(Name = "width", Order = 55)] public int Width { get; set; } /// /// An integer representing the value in pixels for the height of the video in this result. /// [DataMember(Name = "height", Order = 56)] public int Height { get; set; } /// /// A string such as '5204 kb' that specifies the size of the file associated with the video in this result. /// [DataMember(Name = "fileSize", Order = 57)] public string FileSize { get; set; } /// /// A string such as '24 fps' that specifies the frame rate of this video in this result. /// [DataMember(Name = "frameRate", Order = 58)] public string FrameRate { get; set; } /// /// A string that identifies the codec used to encode the video in this result. /// [DataMember(Name = "codec", Order = 59)] public string Codec { get; set; } } }