define(["globalize"], function(globalize) {
	"use strict";
	return {
		getVideoQualityOptions: function(options) {
			var maxStreamingBitrate = options.currentMaxBitrate,
				maxAllowedWidth = options.videoWidth || 4096,
				qualityOptions = [];
			1900 <= maxAllowedWidth && (qualityOptions.push({
				name: "&#x5A92;&#x4F53;&#x6E90;&#x76F4;&#x63A5;&#x4F20;&#x8F93;",
				maxHeight: 2160,
				bitrate: 12e7
			})), 1900 <= maxAllowedWidth ? (qualityOptions.push({
				name: "1080P&#x3010;&#x8D85;&#x9AD8;&#x6E05;&#x3011;",
				maxHeight: 1080,
				bitrate: 6000001
			}), qualityOptions.push({
				name: "1080P&#x3010;&#x9AD8;&#x6E05;&#x3011;",
				maxHeight: 1080,
				bitrate: 5000001
			}), qualityOptions.push({
				name: "1080P&#x3010;&#x6807;&#x6E05;&#x3011;",
				maxHeight: 1080,
				bitrate: 4000002
			})) : 1260 <= maxAllowedWidth ? (qualityOptions.push({
				name: "&#x5A92;&#x4F53;&#x6E90;&#x76F4;&#x63A5;&#x4F20;&#x8F93;",
				maxHeight: 720,
				bitrate: 1e7
			}), qualityOptions.push({
				name: "720P&#x3010;&#x8D85;&#x9AD8;&#x6E05;&#x3011;",
				maxHeight: 720,
				bitrate: 8e6
			}), qualityOptions.push({
				name: "720P&#x3010;&#x9AD8;&#x6E05;&#x3011;",
				maxHeight: 720,
				bitrate: 6e6
			}), qualityOptions.push({
				name: "720P&#x3010;&#x6807;&#x6E05;&#x3011;",
				maxHeight: 720,
				bitrate: 5e6
			})) : 620 <= maxAllowedWidth && (qualityOptions.push({
				name: "&#x5A92;&#x4F53;&#x6E90;&#x76F4;&#x63A5;&#x4F20;&#x8F93;",
				maxHeight: 480,
				bitrate: 4000001
			}), qualityOptions.push({
				name: "480P&#x3010;&#x8D85;&#x9AD8;&#x6E05;&#x3011;",
				maxHeight: 480,
				bitrate: 3000001
			}), qualityOptions.push({
				name: "480P&#x3010;&#x9AD8;&#x6E05;&#x3011;",
				maxHeight: 480,
				bitrate: 25e5
			}), qualityOptions.push({
				name: "480P&#x3010;&#x6807;&#x6E05;&#x3011;",
				maxHeight: 480,
				bitrate: 2000001
			}), qualityOptions.push({
				name: "480P&#x3010;&#x6E05;&#x6670;&#x3011;",
				maxHeight: 480,
				bitrate: 1500001
			})), 1260 <= maxAllowedWidth && (qualityOptions.push({
				name: "720P&#x3010;&#x6E05;&#x6670;&#x3011;",
				maxHeight: 720,
				bitrate: 4e6
			})), qualityOptions.push({
				name: "480P&#x3010;&#x6D41;&#x7545;&#x3011;",
				maxHeight: 480,
				bitrate: 1e6
			}), qualityOptions.push({
				name: "240P&#x3010;&#x6781;&#x901F;&#x3011;",
				maxHeight: 240,
				bitrate: 32e4
			});
			var autoQualityOption = {
				name: globalize.translate("Auto"),
				bitrate: 0,
				selected: options.isAutomaticBitrateEnabled
			};
			if (options.enableAuto && qualityOptions.push(autoQualityOption), maxStreamingBitrate) {
				for (var selectedIndex = -1, i = 0, length = qualityOptions.length; i < length; i++) {
					var option = qualityOptions[i]; - 1 === selectedIndex && option.bitrate <= maxStreamingBitrate && (selectedIndex = i)
				} - 1 === selectedIndex && (selectedIndex = qualityOptions.length - 1);
				var currentQualityOption = qualityOptions[selectedIndex];
				options.isAutomaticBitrateEnabled ? autoQualityOption.autoText = currentQualityOption.name : currentQualityOption.selected = !0
			}
			return qualityOptions
		},
		getAudioQualityOptions: function(options) {
			var maxStreamingBitrate = options.currentMaxBitrate,
				qualityOptions = [];
			qualityOptions.push({
				name: "2M&#x3010;&#x8D85;&#x54C1;&#x8D28;&#x3011;",
				bitrate: 2e6
			}), qualityOptions.push({
				name: "1M&#x3010;&#x9AD8;&#x54C1;&#x8D28;&#x3011;",
				bitrate: 1e6
			}), qualityOptions.push({
				name: "512K&#x3010;&#x8F83;&#x9AD8;&#x3011;",
				bitrate: 512e3
			}), qualityOptions.push({
				name: "320K&#x3010;&#x6807;&#x51C6;&#x3011;",
				bitrate: 32e4
			}), qualityOptions.push({
				name: "192K&#x3010;&#x666E;&#x901A;&#x3011;",
				bitrate: 192e3
			});
			var autoQualityOption = {
				name: globalize.translate("Auto"),
				bitrate: 0,
				selected: options.isAutomaticBitrateEnabled
			};
			if (options.enableAuto && qualityOptions.push(autoQualityOption), maxStreamingBitrate) {
				for (var selectedIndex = -1, i = 0, length = qualityOptions.length; i < length; i++) {
					var option = qualityOptions[i]; - 1 === selectedIndex && option.bitrate <= maxStreamingBitrate && (selectedIndex = i)
				} - 1 === selectedIndex && (selectedIndex = qualityOptions.length - 1);
				var currentQualityOption = qualityOptions[selectedIndex];
				options.isAutomaticBitrateEnabled ? autoQualityOption.autoText = currentQualityOption.name : currentQualityOption.selected = !0
			}
			return qualityOptions
		}
	}
});
