aboutsummaryrefslogtreecommitdiff
path: root/libraries/phpvideotoolkit/examples/common/pluginobject/plugins/windowsmediaplayer.js
blob: 2abe5c19dc8e403aaf47d4a939c21822a334fd6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
PO.L.WindowsMediaPlayer = {
	
	options: {
		upgrade_url			: PO.U.Browser.Linux ? 'http://www.videolan.org/vlc/' : (PO.U.Platform.Apple ? 'http://www.flip4mac.com/wmv_download.htm' : 'http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx'),
		class_id			: 'clsid:22D6f312-B0F6-11D0-94AB-0080C74C7E95',
		codebase			: 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab',
		mime_type			: {
			'audio/x-pn-realaudio-plugin' : []
		},
		bgcolor				: null,
		bgcolour			: null
	},
	
	params: {
// 		AudioStream				: true,	 
// 		AutoSize				: true,	 
// 		AutoStart				: true,	// Sets if the player should start automatically
// 		AnimationAtStart		: true,	// Sets if an animation should show while the file loads
// 		AllowScan				: true,	 
// 		AllowChangeDisplaySize	: true,	 
// 		AutoRewind				: false,
// 		Balance					: false,	 
// 		BaseURL	 				: null,	 
// 		BufferingTime			: 5,	 
// 		CaptioningID 			: null,	 	 
// 		ClickToPlay				: false,	// Sets if the player should start when the user clicks in the play area
// 		CursorType				: false,	 
// 		CurrentPosition			: true,	 
// 		CurrentMarker			: false,	 
// 		DefaultFrame	 		: null,	 
// 		DisplayBackColor		: false,	 
// 		DisplayForeColor		: 16777215,	 
// 		DisplayMode				: false,	 
// 		DisplaySize				: false,	 
// 		Enabled					: true,	 
// 		EnableContextMenu		: true,	 
// 		EnablePositionControls	: true,	 
// 		EnableFullScreenControls: false,	 
// 		EnableTracker			: true,	 
// // 		Filename				: null,	// The URL of the file to play
// 		InvokeURLs				: true,
// 		Language				: true,
// 		Mute					: false,
// 		PlayCount				: 1,
// 		PreviewMode				: false,
// 		Rate					: 1,
// 		SAMILang	 			: null,	 
// 		SAMIStyle	  			: null, 
// 		SAMIFileName	  		: null,	 
// 		SelectionStart			: true,	 
// 		SelectionEnd			: true,	 
// 		SendOpenStateChangeEvents	: true,	 
// 		SendWarningEvents		: true,	 
// 		SendErrorEvents			: true, 
// 		SendKeyboardEvents		: false,	 
// 		SendMouseClickEvents	: false,	 
// 		SendMouseMoveEvents		: false,
// 		SendPlayStateChangeEvents	: true,	 
// 		ShowCaptioning			: false,
// 		ShowControls			: true,	// Sets if the player controls should show
// 		ShowAudioControls		: true,	// Sets if the audio controls should show
// 		ShowDisplay				: false, // Sets if the display should show
// 		ShowGotoBar				: false, // Sets if the GotoBar should show
// 		ShowPositionControls	: true,	 
// 		ShowStatusBar			: false,	 
// 		ShowTracker				: true,	 
// 		TransparantAtStart		: false,	 
// 		VideoBorderWidth		: false,	 
// 		VideoBorderColor		: false,	 
// 		VideoBorder3D			: false,	 
// 		Volume					: -200,	 
// 		WindowlessVideo			: false	 		
	},
	attributes: {},
	
	create: function(src, o, p)
	{
		o = PO.U.merge(o, PO.L.WindowsMediaPlayer.options);
		
		o.params = PO.U.merge(o.params || {}, PO.L.WindowsMediaPlayer.params);
		o.attributes = PO.U.merge(o.attributes || {}, PO.L.WindowsMediaPlayer.attributes);
		
		var bg = o.bgcolour ? o.bgcolour : (o.bgcolor ? o.bgcolor : false);
		if(bg) o.params.bgcolor = bg;

		if(o.placeholder && o.placeholder_autoplay) o.params.AutoStart = true;
		
		return new PO.ObjectEmbed(src, o, PO.L.WindowsMediaPlayer, p);
	},
	
	_installed_version: false,
	detectVersion: function(o, rv)
	{
		if(PO.L.WindowsMediaPlayer._installed_version) return PO.L.WindowsMediaPlayer._installed_version;
		var pv = false,a;
		if(navigator.plugins && navigator.plugins.length > 0)
		{
			np = navigator.plugins;
			for (a=0; a < np.length; a++ ) 
			{
			    if(np[a].name.indexOf('Windows Media') > -1) 
				{
					pv = true;
					break;
			    }
			}
		}
		else
		{
			execScript('on error resume next: mp2 = IsObject(CreateObject("MediaPlayer.MediaPlayer.1"))', 'VBScript');
			pv = (mp2);
		}
		pv = new PO.U.PlayerVersion([(pv === true) ? 1 : 0, 0, 0]);
		PO.L.WindowsMediaPlayer._installed_version = pv;
		return pv;
	}
	
};
PO.Plugins.WindowsMediaPlayer.loaded = 1;