PageSourceSearch

https://r-e-f.org/plugins/system/mediaobject/js/mediaobject-150.js

js r-e-f.org collected 2026-09-27 20:57:03 UTC 3,721 bytes, 149 lines download raw bytes

1/*
2 * Media Object 1.5.0
3 *
4 * Copyright (c) 2007 - 2008 Ryan Demmer (www.joomlacontenteditor.net)
5 * Licensed under the GPL (http://www.gnu.org/licenses/licenses.html#GPL)license.
6 * Based on the Moxiecode Embed script
7 */
8var MediaObject = {
9	version : {
10		'flash' 		: '9,0,124,0',
11		'windowsmedia'	: '5,1,52,701',
12		'quicktime'		: '6,0,2,0',
13		'realmedia'		: '7,0,0,0',
14		'shockwave'		: '8,5,1,0'
15	},
16	init : function(v){
17		var t = this;
18		for(n in v){
19			t.version[n] = v[n];	
20		}
21	},
22	getSite : function(){
23		var x, s = document.getElementsByTagName('script');
24		for(x=0; x<s.length; x++){
25			if(/mediaobject\/js\/mediaobject-150.js/i.test(s[x].src)){
26				site = s[x].src;
27			}
28		}
29		return site.substring(0, site.lastIndexOf('plugins/system/mediaobject/js')).replace(/http:\/\/([^\/]+)/, '');
30	},
31	writeObject : function(cls, cb, mt, p){
32		var h = '', n;
33		var msie 	= /msie/i.test(navigator.userAgent);
34		var webkit 	= /webkit/i.test(navigator.userAgent);
35		
36		if(!/:\/\//.test(p.src)){
37			p.src = this.getSite() + p.src;	
38			if(mt == 'video/x-ms-wmv'){
39				p.url = p.src;
40			}
41			if(mt == 'application/x-shockwave-flash'){
42				p.movie = p.src;
43				delete p.src;	
44			}
45		}
46		h += '<object ';
47		if(mt == 'application/x-shockwave-flash'){
48			h += 'type="'+ mt +'" data="'+ p.movie +'" ';	
49		}else{
50			h += 'codebase="' + cb + '" classid="clsid:' + cls + '" ';
51		}
52		for (n in p){
53			if(p[n] !== ''){
54				if (/(id|name|width|height|style)$/.test(n)){
55					h += n + '="' + p[n] + '"';	
56				}
57			}
58		}
59		h += '>';
60		for (n in p){
61			if(p[n] !== ''){
62				if (!/(id|name|width|height|style)$/.test(n)){
63					h += '<param name="' + n + '" value="' + p[n] + '">';
64				}
65			}
66		}
67		if(!msie && mt != 'application/x-shockwave-flash'){
68			h += '<object type="'+ mt +'" data="'+ p.src +'"';
69			for (n in p){
70				if(p[n] !== ''){
71					h += n + '="' + p[n] + '"';
72				}
73			}
74			h += '></object>';	
75		}
76		h += '</object>';
77		document.write(h);		
78	},
79	flash : function(p) {
80		if(typeof p.wmode == 'undefined'){
81			p['wmode'] = 'opaque';
82		}
83		this.writeObject(
84			'D27CDB6E-AE6D-11cf-96B8-444553540000',
85			'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.version['flash'],
86			'application/x-shockwave-flash',
87			p
88		);
89	},
90	shockwave : function(p) {
91		this.writeObject(
92		'166B1BCA-3F9C-11CF-8075-444553540000',
93		'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version='  + this.version['shockwave'],
94		'application/x-director',
95			p
96		);
97	},
98	quicktime : function(p) {
99		this.writeObject(
100			'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
101			'http://www.apple.com/qtactivex/qtplugin.cab#version=' + this.version['quicktime'],
102			'video/quicktime',
103			p
104		);
105	},
106	realmedia : function(p) {
107		this.writeObject(
108			'CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA',
109			'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.version['realmedia'],
110			'audio/x-pn-realaudio-plugin',
111			p
112		);
113	},
114	windowsmedia : function(p) {
115		p.url = p.src;
116		this.writeObject(
117			'6BF52A52-394A-11D3-B153-00C04F79FAA6',
118			'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=' + this.version['windowsmedia'],
119			'video/x-ms-wmv',
120			p
121		);
122	},
123	divx : function(p) {
124		this.writeObject(
125			'67DABFBF-D0AB-41FA-9C46-CC0F21721616',
126			'http://go.divx.com/plugin/DivXBrowserPlugin.cab',
127			'video/divx',
128			p
129		);
130	}
131}
132function writeFlash(p) {
133	MediaObject.flash(p);
134}
135function writeShockWave(p) {
136	MediaObject.shockwave(p);
137}
138function writeQuickTime(p) {
139	MediaObject.quicktime(p);
140}
141function writeRealMedia(p) {
142	MediaObject.realmedia(p);
143}
144function writeWindowsMedia(p) {
145	MediaObject.windowsmedia(p);
146}
147function writeDivX(p) {
148	MediaObject.divx(p);
149}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.