/*
 * -- Tewonder code description start --
 * Name: se.tewonder.Global.GlobalObjects.MediaManager.MediaObjects.QuickTimeVideoObject
 * Type: Class
 * Version: 0.3.01
 *
 * Edited by: Mattias Ekendahl (mattias@tewonder.se)
 * Updates:
 *
 * Notes:
 * Todo: 
 * -- Tewonder code description end --
 */

function gTewonderLocalScopeFunction() {

	var QuickTimeVideoObject = (function() {
		//alert("se.tewonder.Global.GlobalObjects.MediaManager.MediaObjects.QuickTimeVideoObject");
		this.type = "quicktimeVideo";
			
		var currentFunction = function(aName, aValue) {
			this.filePath = aValue;
		}
		this.addSetParameterFunction(currentFunction, ["src"]);
		
		this.setParameter("classid", "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B");
		this.setParameter("codebase", "http://www.apple.com/qtactivex/qtplugin.cab");
		this.setParameter("pluginspage", "http://www.apple.com/quicktime/download/");
		this.setParameter("type", "video/quicktime");
		
		this.canShowMedia = (function() {
			return gTewonderGlobalObjects["pluginDetector"].detectByMimeType("video/quicktime", null);
		});
		
		this.canHandleFileByPath = (function(aFilePath) {
			//Returnvalues: 0 = can't handle file, 1 = is primary handler for file, 2 = can handle file
			var filePathWithoutQueryString;
			var questionMarkPosition = aFilePath.indexOf("?");
			if(questionMarkPosition != -1) {
				filePathWithoutQueryString = aFilePath.substring(0, questionMarkPosition);
			}
			else {
				filePathWithoutQueryString = aFilePath;
			}
			var extension = filePathWithoutQueryString.substring(filePathWithoutQueryString.lastIndexOf(".")+1, filePathWithoutQueryString.length).toLowerCase();
			var currentArray = ["mov"];
			for(var i = -1; ++i < currentArray.length;) {
				if(extension == currentArray[i]) return 2;
			}
			return 0;
		});
		
		this.initializeHtmlRendering = (function() {
			//alert("se.tewonder.Global.GlobalObjects.MediaManager.MediaObjects.QuickTimeVideoObject::initializeHtmlRendering");
			var theFilePath = this.filePath;
			this.embedAttributesObject["src"] = theFilePath;
			this.paramsObject["src"] = theFilePath;
		});
	});
	
	QuickTimeVideoObject.getGetPlayerHtml = (function(aType) {
		var htmlText = "";
		switch(aType) {
			case "default":
				htmlText = "";
				break;
			default:
				break;
		}
		return htmlText;
	});
	
	gTewonderGlobalFunctions.addClass("se.tewonder.Global.GlobalObjects.MediaManager.MediaObjects.QuickTimeVideoObject", QuickTimeVideoObject);
	
	gTewonderGlobalFunctions.setClassInheritance(gTewonderClasses.se.tewonder.Global.GlobalObjects.MediaManager.MediaObjects.QuickTimeVideoObject, gTewonderClasses.se.tewonder.Global.GlobalObjects.MediaManager.MediaObjects.ObjectsObject);
	
}

gTewonderLocalScopeFunction();
