';
s += ' ';
s += ' ';
s += '';
}else{
// Fix youtube url
if(this.url.contains('youtube.com/')) {
this.url = this.url.replace(/youtube\.com\/watch\?v=/i, "youtube.com/v/");
}
// Flash object (SWF)
s += '';
}
}else if (this.contentType == "audio/mpeg") {
// We use the flash mp3 player
s += '';
}else {
// Other video types
var pluginspace, codebase, classid;
if(this.contentType == "video/quicktime" || this.contentType == "video/mp4" || this.contentType == "video/mpeg" || this.contentType == "video/x-msvideo" ) {
// QUICKTIME
this.autoplay = (this.autoplay == 'true' || this.autoplay == '1') ? 'true' : 'false';
s += '';
}else{
// WINDOWS MEDIA & OTHERS
this.autoplay = (this.autoplay == 'true' || this.autoplay == '1') ? 'true' : 'false';
s += '';
s += '';
s += '';
s += '';
s += '';
s += '';
s += ' ';
s += '';
}
}
return s;
}
/** Set movie attribute */
Movie.prototype.setAttribute = function(attr, val) {
if (val=="true") {
this[attr]=true;
} else if (val=="false") {
this[attr]=false;
} else {
this[attr]=val;
}
};
/** Get the file extension */
function getExtension(url) {
var ext = url.match(/\.(avi|asf|fla|flv|mov|mp3|mp4|m4v|mpg|mpeg|mpv|qt|swf|wma|wmv)$/i);
if(ext != null && ext.length && ext.length > 0) {
ext = ext[1];
}else{
if(url.contains('youtube.com/')) {
ext = 'swf';
}else{
ext = '';
}
}
return ext;
}
/** Configure content type basing on provided url */
function getContentType(url) {
var ext = getExtension(url);
var contentType =
(ext=="mpg"||ext=="mpeg"||ext=="mpv") ? "video/mpeg":
(ext=="mp4") ? "video/mp4":
(ext=="m4v") ? "video/mp4":
(ext=="mp3") ? "audio/mpeg":
(ext=="flv"||ext=="fla"||ext=="swf") ? "application/x-shockwave-flash":
(ext=="wmv"||ext=="wm") ? "video/x-ms-wmv":
(ext=="avi") ? "video/x-msvideo":
(ext=="asf") ? "video/x-ms-asf":
(ext=="wma") ? "audio/x-ms-wma":
(ext=="mov"||ext=="qt") ? "video/quicktime" : "video/x-ms-wmv";
return contentType;
}
Movie.prototype.setObjectElement = function (e){
if (!e) return ;
this.width = GetAttribute( e, 'width', this.width );
this.height = GetAttribute( e, 'height', this.height );
};
String.prototype.endsWith = function(str) {
return (this.match(str+"$")==str)
}
String.prototype.startsWith = function(str) {
return (this.match("^"+str)==str)
}
String.prototype.contains = function(str) {
return (this.match(str)==str)
}
/** Set selected URL from Browser */
function SetUrl(url) {
document.getElementById('txtUrl').value = url;
}
function showElement(element, isVisible) {
if (typeof (element) == 'string')
element = document.getElementById(element);
element.style.display = isVisible ? '' : 'none';
}
function GetAttribute( element, attName, valueIfNull ) {
var oAtt = element.attributes[attName] ;
if ( oAtt == null || !oAtt.specified )
return valueIfNull ? valueIfNull : '' ;
var oValue = element.getAttribute( attName, 2 ) ;
if ( oValue == null )
oValue = oAtt.nodeValue ;
return ( oValue == null ? valueIfNull : oValue ) ;
}