package net.fdms.Database 
{
	import net.fdms.Function.Convert.XMLtoOBJECT;
	/**
	 * 2011/5/16 9:35
	 * @author Dawnboy
	 */
	public class VideoData 
	{
		private static var _videoData:Array = new Array(2);
		public function VideoData() 
		{
			/*_videoData = [
			//上传视频列表
				[
					{id:"", title:"视频", cover:"视频封面", src:"视频路径" },
					{id:"", title:"视频", cover:"视频封面", src:"视频路径" }
				],
			//收藏视频列表
				[
					{id:"", title:"视频", cover:"视频封面", src:"视频路径" },
					{id:"", title:"视频", cover:"视频封面", src:"视频路径" }
				]
			]*/
		}
		
		/**
		 * 初始化视频数据
		 * @param	videoSets
		 */
		public static function init(videoSets:XMLList):void {		
			if (videoSets.myvideo.children().length()) {
				var Un:int = videoSets.myvideo.children().length();
				_videoData[0] = [];
				for (var a:int = 0; a < Un; a++) {
					_videoData[0].push(XMLtoOBJECT.convert(videoSets.myvideo.item[a]));
				}
			}
			
			if (videoSets.favvideo.children().length()) {
				var Fn:int = videoSets.favvideo.children().length();
				_videoData[1] = [];
				for (var b:int = 0; b < Fn; b++) {
					_videoData[1].push(XMLtoOBJECT.convert(videoSets.favvideo.item[b]));
				}
			}
			
			//trace("上传视频共 " + _videoData[0].length + " 条\n收藏视频共 " + _videoData[1].length + " 条\n---------------------------------");
		}
		
		/**
		 * 获取上传视频列表
		 * @return
		 */
		public static function getUploadVideo():Array {
			return _videoData[0];
		}
		
		/**
		 * 获取收藏视频列表
		 * @return
		 */
		public static function getFavVideo():Array {
			return _videoData[1];
		}

	}

}