Open-Source PHP Framework - Designed for rapid development of performance-oriented scalable applications

/webroot/js/tinymce/plugins/media/js/embed.js

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