bgneal@312
|
1 /**
|
bgneal@312
|
2 * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
|
bgneal@312
|
3 */
|
bgneal@312
|
4
|
bgneal@312
|
5 function writeFlash(p) {
|
bgneal@312
|
6 writeEmbed(
|
bgneal@312
|
7 'D27CDB6E-AE6D-11cf-96B8-444553540000',
|
bgneal@312
|
8 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
bgneal@312
|
9 'application/x-shockwave-flash',
|
bgneal@312
|
10 p
|
bgneal@312
|
11 );
|
bgneal@312
|
12 }
|
bgneal@312
|
13
|
bgneal@312
|
14 function writeShockWave(p) {
|
bgneal@312
|
15 writeEmbed(
|
bgneal@312
|
16 '166B1BCA-3F9C-11CF-8075-444553540000',
|
bgneal@312
|
17 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
|
bgneal@312
|
18 'application/x-director',
|
bgneal@312
|
19 p
|
bgneal@312
|
20 );
|
bgneal@312
|
21 }
|
bgneal@312
|
22
|
bgneal@312
|
23 function writeQuickTime(p) {
|
bgneal@312
|
24 writeEmbed(
|
bgneal@312
|
25 '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
|
bgneal@312
|
26 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
|
bgneal@312
|
27 'video/quicktime',
|
bgneal@312
|
28 p
|
bgneal@312
|
29 );
|
bgneal@312
|
30 }
|
bgneal@312
|
31
|
bgneal@312
|
32 function writeRealMedia(p) {
|
bgneal@312
|
33 writeEmbed(
|
bgneal@312
|
34 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
|
bgneal@312
|
35 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
bgneal@312
|
36 'audio/x-pn-realaudio-plugin',
|
bgneal@312
|
37 p
|
bgneal@312
|
38 );
|
bgneal@312
|
39 }
|
bgneal@312
|
40
|
bgneal@312
|
41 function writeWindowsMedia(p) {
|
bgneal@312
|
42 p.url = p.src;
|
bgneal@312
|
43 writeEmbed(
|
bgneal@312
|
44 '6BF52A52-394A-11D3-B153-00C04F79FAA6',
|
bgneal@312
|
45 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
|
bgneal@312
|
46 'application/x-mplayer2',
|
bgneal@312
|
47 p
|
bgneal@312
|
48 );
|
bgneal@312
|
49 }
|
bgneal@312
|
50
|
bgneal@312
|
51 function writeEmbed(cls, cb, mt, p) {
|
bgneal@312
|
52 var h = '', n;
|
bgneal@312
|
53
|
bgneal@312
|
54 h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
|
bgneal@312
|
55 h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
|
bgneal@312
|
56 h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
|
bgneal@312
|
57 h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
|
bgneal@312
|
58 h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
|
bgneal@312
|
59 h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
|
bgneal@312
|
60 h += '>';
|
bgneal@312
|
61
|
bgneal@312
|
62 for (n in p)
|
bgneal@312
|
63 h += '<param name="' + n + '" value="' + p[n] + '">';
|
bgneal@312
|
64
|
bgneal@312
|
65 h += '<embed type="' + mt + '"';
|
bgneal@312
|
66
|
bgneal@312
|
67 for (n in p)
|
bgneal@312
|
68 h += n + '="' + p[n] + '" ';
|
bgneal@312
|
69
|
bgneal@312
|
70 h += '></embed></object>';
|
bgneal@312
|
71
|
bgneal@312
|
72 document.write(h);
|
bgneal@312
|
73 }
|