Subversion Repositories php-qbpwcf

Rev

Rev 3 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 226
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2024 Min-Jhin,Chen
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 47... Line 47...
47
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
47
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
48
	#備註:
48
	#備註:
49
	#無.
49
	#無.
50
	*/
50
	*/
51
	public function __call($method,$arguments){
51
	public function __call($method,$arguments){
52
		
52
 
53
		#取得當前執行的函式
53
		#取得當前執行的函式
54
		$result["function"]=__FUNCTION__;
54
		$result["function"]=__FUNCTION__;
55
		
55
 
56
		#設置執行不正常
56
		#設置執行不正常
57
		$result["status"]="false";
57
		$result["status"]="false";
58
		
58
 
59
		#設置執行錯誤
59
		#設置執行錯誤
60
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
60
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
61
		
61
 
62
		#設置所丟入的參數
62
		#設置所丟入的參數
63
		$result["error"][]=$arguments;
63
		$result["error"][]=$arguments;
64
		
64
 
65
		#回傳結果
65
		#回傳結果
66
		return $result;
66
		return $result;
67
		
67
 
68
		}#function __call end
68
		}#function __call end
69
		
69
 
70
	/*
70
	/*
71
	#函式說明:
71
	#函式說明:
72
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
72
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
73
	#回傳結果:
73
	#回傳結果:
74
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
74
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
Line 83... Line 83...
83
	#__callStatic=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
83
	#__callStatic=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
84
	#備註:
84
	#備註:
85
	#無.
85
	#無.
86
	*/
86
	*/
87
	public static function __callStatic($method,$arguments){
87
	public static function __callStatic($method,$arguments){
88
		
88
 
89
		#取得當前執行的函式
89
		#取得當前執行的函式
90
		$result["function"]=__FUNCTION__;
90
		$result["function"]=__FUNCTION__;
91
		
91
 
92
		#設置執行不正常
92
		#設置執行不正常
93
		$result["status"]="false";
93
		$result["status"]="false";
94
		
94
 
95
		#設置執行錯誤
95
		#設置執行錯誤
96
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
96
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
97
		
97
 
98
		#設置所丟入的參數
98
		#設置所丟入的參數
99
		$result["error"][]=$arguments;
99
		$result["error"][]=$arguments;
100
		
100
 
101
		#回傳結果
101
		#回傳結果
102
		return $result;
102
		return $result;
103
		
103
 
104
		}#function __callStatic end
104
		}#function __callStatic end
105
	
105
 
106
	/*
106
	/*
107
	#函式說明:
107
	#函式說明:
108
	#放置html5支援的webm格式影片(webm),結果會回傳語法.
108
	#放置html5支援的webm格式影片(webm),結果會回傳語法.
109
	#回傳結果:
109
	#回傳結果:
110
	#$result["status"],執行正常與否,"true"代表正常;"false"代表不正常.
110
	#$result["status"],執行正常與否,"true"代表正常;"false"代表不正常.
Line 140... Line 140...
140
	#$conf["class"]="";
140
	#$conf["class"]="";
141
	#參考資料:
141
	#參考資料:
142
	#無.
142
	#無.
143
	#備註:
143
	#備註:
144
	#建議增加影片載入完畢就自動播放的js.
144
	#建議增加影片載入完畢就自動播放的js.
145
	*/	
145
	*/
146
	public static function html5(&$conf){
146
	public static function html5(&$conf){
147
	
147
 
148
		#初始化要回傳的內容
148
		#初始化要回傳的內容
149
		$result=array();
149
		$result=array();
150
		
150
 
151
		#取得當前函數名稱
151
		#取得當前函數名稱
152
		$result["function"]=__FUNCTION__;
152
		$result["function"]=__FUNCTION__;
153
		
153
 
154
		#如果 $conf 不為陣列
154
		#如果 $conf 不為陣列
155
		if(gettype($conf)!="array"){
155
		if(gettype($conf)!="array"){
156
			
156
 
157
			#設置執行失敗
157
			#設置執行失敗
158
			$result["status"]="false";
158
			$result["status"]="false";
159
			
159
 
160
			#設置執行錯誤訊息
160
			#設置執行錯誤訊息
161
			$result["error"][]="\$conf變數須為陣列形態";
161
			$result["error"][]="\$conf變數須為陣列形態";
162
 
162
 
163
			#如果傳入的參數為 null
163
			#如果傳入的參數為 null
164
			if($conf==null){
164
			if($conf==null){
165
				
165
 
166
				#設置執行錯誤訊息
166
				#設置執行錯誤訊息
167
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
167
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
168
				
168
 
169
				}#if end
169
				}#if end
170
 
170
 
171
			#回傳結果
171
			#回傳結果
172
			return $result;
172
			return $result;
173
			
173
 
174
			}#if end
174
			}#if end
175
			
175
 
176
		#初始化要回傳的語法
176
		#初始化要回傳的語法
177
		$result["content"]="";
177
		$result["content"]="";
178
		
178
 
179
		#檢查參數
179
		#檢查參數
180
		#函式說明:
180
		#函式說明:
181
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
181
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
182
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
182
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
183
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
183
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 192... Line 192...
192
		#必填寫的參數:
192
		#必填寫的參數:
193
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
193
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
194
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
194
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
195
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
195
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
196
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("fileArgu","videoFilePosition");
196
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("fileArgu","videoFilePosition");
197
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); 
197
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object");
198
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
198
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
199
		#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
199
		#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
200
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
200
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
201
		#可以省略的參數:
201
		#可以省略的參數:
202
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
202
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
203
		$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
203
		$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
204
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
204
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
205
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("width","height","codecs","autoplay","loop","controlls","class","muted","styleAttr","styleVal");
205
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("width","height","codecs","autoplay","loop","controlls","class","muted","styleAttr","styleVal");
206
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
206
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
207
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","string","string","string","array","array");
207
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","string","string","string","array","array");
208
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
208
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
209
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null,"vp8, vorbis","false","false","false",null,"false",null,null);
209
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null,"vp8, vorbis","false","false","false",null,"false",null,null);
210
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
210
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
211
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("styleAttr","styleVal");
211
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("styleAttr","styleVal");
212
		#參考資料來源:
212
		#參考資料來源:
213
		#array_keys=>http://php.net/manual/en/function.array-keys.php
213
		#array_keys=>http://php.net/manual/en/function.array-keys.php
214
		$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
214
		$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
215
		unset($conf["variableCheck::checkArguments"]);
215
		unset($conf["variableCheck::checkArguments"]);
216
	
216
 
217
		#如果檢查失敗
217
		#如果檢查失敗
218
		if($checkArguments["status"]==="false"){
218
		if($checkArguments["status"]==="false"){
219
			
219
 
220
			#設置錯誤識別
220
			#設置錯誤識別
221
			$result["status"]="false";
221
			$result["status"]="false";
222
			
222
 
223
			#設置錯誤訊息
223
			#設置錯誤訊息
224
			$result["error"]=$checkArguments;
224
			$result["error"]=$checkArguments;
225
			
225
 
226
			#回傳結果
226
			#回傳結果
227
			return $result;
227
			return $result;
228
			
228
 
229
			}#if end
229
			}#if end
230
	
230
 
231
		#如果檢查不通過
231
		#如果檢查不通過
232
		if($checkArguments["passed"]=="false"){
232
		if($checkArguments["passed"]=="false"){
233
			
233
 
234
			#設置錯誤識別
234
			#設置錯誤識別
235
			$result["status"]="false";
235
			$result["status"]="false";
236
			
236
 
237
			#設置錯誤訊息
237
			#設置錯誤訊息
238
			$result["error"]=$checkArguments;
238
			$result["error"]=$checkArguments;
239
			
239
 
240
			#回傳結果
240
			#回傳結果
241
			return $result;
241
			return $result;
242
			
242
 
243
			}#if end
243
			}#if end
244
		
244
 
245
		#檢查影片檔案是否存在
245
		#檢查影片檔案是否存在
246
		#函式說明:檢查多個檔案與資料夾是否存在.
246
		#函式說明:檢查多個檔案與資料夾是否存在.
247
		#回傳的結果:
247
		#回傳的結果:
248
		#$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
248
		#$result["status"],執行正常與否,"true"代表正常,"false"代表不正常.
249
		#$result["error"],錯誤訊息陣列.
249
		#$result["error"],錯誤訊息陣列.
Line 268... Line 268...
268
		$checkMultiFileExist=fileAccess::checkMultiFileExist($conf["fileAccess::checkMultiFileExist"]);
268
		$checkMultiFileExist=fileAccess::checkMultiFileExist($conf["fileAccess::checkMultiFileExist"]);
269
		unset($conf["fileAccess::checkMultiFileExist"]);
269
		unset($conf["fileAccess::checkMultiFileExist"]);
270
 
270
 
271
		#如果檢查失敗
271
		#如果檢查失敗
272
		if($checkMultiFileExist["status"]=="false"){
272
		if($checkMultiFileExist["status"]=="false"){
273
			
273
 
274
			#設置執行不正常
274
			#設置執行不正常
275
			$result["status"]="false";
275
			$result["status"]="false";
276
			
276
 
277
			#設置執行錯誤
277
			#設置執行錯誤
278
			$result["error"]=$checkMultiFileExist;
278
			$result["error"]=$checkMultiFileExist;
279
			
279
 
280
			#回傳結果
280
			#回傳結果
281
			return $result;
281
			return $result;
282
			
282
 
283
			}#if end
283
			}#if end
284
			
284
 
285
		#如果聲音檔案不存在
285
		#如果聲音檔案不存在
286
		if($checkMultiFileExist["varExist"][0]=="false"){
286
		if($checkMultiFileExist["varExist"][0]=="false"){
287
			
287
 
288
			#設置執行不正常
288
			#設置執行不正常
289
			$result["status"]="false";
289
			$result["status"]="false";
290
			
290
 
291
			#設置執行錯誤
291
			#設置執行錯誤
292
			$result["error"][]="影片檔案「".$checkMultiFileExist["varName"][0]."」不存在!";
292
			$result["error"][]="影片檔案「".$checkMultiFileExist["varName"][0]."」不存在!";
293
			
293
 
294
			#回傳結果
294
			#回傳結果
295
			return $result;
295
			return $result;
296
			
296
 
297
			}#if end
297
			}#if end
298
			
298
 
299
		#將聲音檔案用 base64 形式壓縮成16近位的英文數字
299
		#將聲音檔案用 base64 形式壓縮成16近位的英文數字
300
		#函數說明:
300
		#函數說明:
301
		#用data:mimeType;base64,fileVar的形式來提供檔案的連結,亦即檔案儲存在變數裡面.
301
		#用data:mimeType;base64,fileVar的形式來提供檔案的連結,亦即檔案儲存在變數裡面.
302
		#回傳結果:
302
		#回傳結果:
303
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
303
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
304
		#$result["error"],錯誤訊息
304
		#$result["error"],錯誤訊息
305
		#$result["content"],檔案變數的內容
305
		#$result["content"],檔案變數的內容
306
		#$result["fileTypeName"],副檔名,ex:「.tar.xz」.
306
		#$result["fileTypeName"],副檔名,ex:「.tar.xz」.
307
		#$result["function"],當前執行的函數名稱 
307
		#$result["function"],當前執行的函數名稱
308
		#必填參數:
308
		#必填參數:
309
		#$conf["filePosition"],要轉存成2元碼的圖片檔案位置與名稱
309
		#$conf["filePosition"],要轉存成2元碼的圖片檔案位置與名稱
310
		$conf["fileAccess::data"]["filePosition"]=$conf["videoFilePosition"];
310
		$conf["fileAccess::data"]["filePosition"]=$conf["videoFilePosition"];
311
		#$conf["mimeType"],2元碼的內容是什麼
311
		#$conf["mimeType"],2元碼的內容是什麼
312
		$conf["fileAccess::data"]["mimeType"]="video/*";
312
		$conf["fileAccess::data"]["mimeType"]="video/*";
Line 321... Line 321...
321
		$data=fileAccess::data($conf["fileAccess::data"]);
321
		$data=fileAccess::data($conf["fileAccess::data"]);
322
		unset($conf["fileAccess::data"]);
322
		unset($conf["fileAccess::data"]);
323
 
323
 
324
		#如果將聲音檔案用 base64 形式壓縮成16近位的英文數字失敗
324
		#如果將聲音檔案用 base64 形式壓縮成16近位的英文數字失敗
325
		if($data["status"]=="false"){
325
		if($data["status"]=="false"){
326
			
326
 
327
			#設置執行不正常
327
			#設置執行不正常
328
			$result["status"]="false";
328
			$result["status"]="false";
329
			
329
 
330
			#設置執行錯誤
330
			#設置執行錯誤
331
			$result["error"]=$data;
331
			$result["error"]=$data;
332
			
332
 
333
			#回傳結果
333
			#回傳結果
334
			return $result;
334
			return $result;
335
			
335
 
336
			}#if end
336
			}#if end
337
		
337
 
338
		#如果$conf["width"]有設定
338
		#如果$conf["width"]有設定
339
		if(isset($conf["width"])){
339
		if(isset($conf["width"])){
340
 
340
 
341
			#則按照指定的寬度	
341
			#則按照指定的寬度
342
			$conf["width"]="width = ".$conf["width"];
342
			$conf["width"]="width = ".$conf["width"];
343
			
343
 
344
			}#if end
344
			}#if end
345
 
345
 
346
		#如果$conf["width"]沒有設定
346
		#如果$conf["width"]沒有設定
347
		else{
347
		else{
348
			
348
 
349
			$conf["width"]="";
349
			$conf["width"]="";
350
			
350
 
351
			}#else end
351
			}#else end
352
 
352
 
353
		#如果$conf["height"]有設定
353
		#如果$conf["height"]有設定
354
		if(isset($conf["height"])){
354
		if(isset($conf["height"])){
355
 
355
 
356
			#則按照指定的高度
356
			#則按照指定的高度
357
			$conf["height"]="height = ".$conf["height"];
357
			$conf["height"]="height = ".$conf["height"];
358
			
358
 
359
			}#if end
359
			}#if end
360
 
360
 
361
		#如果$conf["height"]沒有設定
361
		#如果$conf["height"]沒有設定
362
		else{
362
		else{
363
			
363
 
364
			#則$conf["height"]爲空
364
			#則$conf["height"]爲空
365
			$conf["height"]="";
365
			$conf["height"]="";
366
			
366
 
367
			}#else end
367
			}#else end
368
 
368
 
369
		#設置解碼器
369
		#設置解碼器
370
		$conf["codecs"]=" codecs=".$conf["codecs"];
370
		$conf["codecs"]=" codecs=".$conf["codecs"];
371
		
371
 
372
		#預設不自動播放
372
		#預設不自動播放
373
		$autoplay="";
373
		$autoplay="";
374
		
374
 
375
		#如果 $conf["autoplay"] 為 "true"
375
		#如果 $conf["autoplay"] 為 "true"
376
		if($conf["autoplay"]==="true"){
376
		if($conf["autoplay"]==="true"){
377
			
377
 
378
			#設置自動播放
378
			#設置自動播放
379
			$autoplay="autoplay";
379
			$autoplay="autoplay";
380
			
380
 
381
			}#if end
381
			}#if end
382
					
382
 
383
		#如果$conf["loop"]為"true"
383
		#如果$conf["loop"]為"true"
384
		if($conf["loop"]=="true"){
384
		if($conf["loop"]=="true"){
385
 
385
 
386
			#則放置重複播放的語法		
386
			#則放置重複播放的語法
387
			$conf["loop"]=" loop=loop";
387
			$conf["loop"]=" loop=loop";
388
			
388
 
389
			}#if end
389
			}#if end
390
			
390
 
391
		#反之	
391
		#反之
392
		else{
392
		else{
393
			
393
 
394
			#設為空字串
394
			#設為空字串
395
			$conf["loop"]="";
395
			$conf["loop"]="";
396
			
396
 
397
			}#else end
397
			}#else end
398
		
398
 
399
		#如果有設置 class 
399
		#如果有設置 class
400
		if(isset($conf["class"])){
400
		if(isset($conf["class"])){
401
		
401
 
402
			#設置 class
402
			#設置 class
403
			$conf["class"]="class='".$conf["class"]."'";
403
			$conf["class"]="class='".$conf["class"]."'";
404
		
404
 
405
			}#if end
405
			}#if end
406
		
406
 
407
		#反之
407
		#反之
408
		else{
408
		else{
409
		
409
 
410
			#設置為空字串
410
			#設置為空字串
411
			$conf["class"]="";
411
			$conf["class"]="";
412
		
412
 
413
			}
413
			}
414
			
414
 
415
		#初始化控制器語法
415
		#初始化控制器語法
416
		$controls="";
416
		$controls="";
417
	
417
 
418
		#如果要顯示控制列
418
		#如果要顯示控制列
419
		if($conf["controlls"]==="true"){
419
		if($conf["controlls"]==="true"){
420
		
420
 
421
			#設定要顯示控制列
421
			#設定要顯示控制列
422
			$controls="controls=controls";
422
			$controls="controls=controls";
423
		
423
 
424
			}#if end
424
			}#if end
425
		
425
 
426
		#預設不靜音
426
		#預設不靜音
427
		$muted="";	
427
		$muted="";
428
			
428
 
429
		#如果要靜音
429
		#如果要靜音
430
		if($conf["muted"]==="true"){
430
		if($conf["muted"]==="true"){
431
		
431
 
432
			#設置要靜音
432
			#設置要靜音
433
			$muted="muted";
433
			$muted="muted";
434
		
434
 
435
			}#if end	
435
			}#if end
436
		
436
 
437
		#初始化style為空
437
		#初始化style為空
438
		$style="";
438
		$style="";
439
		
439
 
440
		#如果有設定 styleName 跟 styleVal
440
		#如果有設定 styleName 跟 styleVal
441
		if( isset($conf["styleName"]) && isset($conf["styleVal"]) ){
441
		if( isset($conf["styleName"]) && isset($conf["styleVal"]) ){
442
		
442
 
443
			#函式說明:
443
			#函式說明:
444
			#建立給與html標籤使用的style屬性字串.
444
			#建立給與html標籤使用的style屬性字串.
445
			#回傳結果:
445
			#回傳結果:
446
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
446
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
447
			#$result["function"],當前執行的函數
447
			#$result["function"],當前執行的函數
Line 456... Line 456...
456
			#無.
456
			#無.
457
			#備註:
457
			#備註:
458
			#無.
458
			#無.
459
			$styleStr=css::styleStr($conf["css::styleStr"]);
459
			$styleStr=css::styleStr($conf["css::styleStr"]);
460
			unset($conf["css::styleStr"]);
460
			unset($conf["css::styleStr"]);
461
		
461
 
462
			if($styleStr["status"]=="false"){
462
			if($styleStr["status"]=="false"){
463
			
463
 
464
				#設置執行不正常
464
				#設置執行不正常
465
				$result["status"]="false";
465
				$result["status"]="false";
466
				
466
 
467
				#設置執行錯誤
467
				#設置執行錯誤
468
				$result["error"]=$styleStr;
468
				$result["error"]=$styleStr;
469
			
469
 
470
				#回傳結果
470
				#回傳結果
471
				return $result;
471
				return $result;
472
			
472
 
473
				}#if end
473
				}#if end
474
				
474
 
475
			#設置style
475
			#設置style
476
			$style=$styleStr["content"];
476
			$style=$styleStr["content"];
477
		
477
 
478
			}#if end
478
			}#if end
479
		
479
 
480
		#語法開始,寬度,高度,控制面板		
480
		#語法開始,寬度,高度,控制面板
481
		$result["content"]=$result["content"]."<video ".$conf["width"]." ".$conf["height"]." ".$controls." ".$autoplay." ".$conf["loop"]." ".$conf["class"]." >";
481
		$result["content"]=$result["content"]."<video ".$conf["width"]." ".$conf["height"]." ".$controls." ".$autoplay." ".$conf["loop"]." ".$conf["class"]." >";
482
		$base64data="<video ".$conf["width"]." ".$conf["height"]." controls=controls ".$autoplay." ".$conf["loop"]." ".$conf["class"]." ".$muted." ".$style.">";
482
		$base64data="<video ".$conf["width"]." ".$conf["height"]." controls=controls ".$autoplay." ".$conf["loop"]." ".$conf["class"]." ".$muted." ".$style.">";
483
	
483
 
484
		#影片檔案位置,類型,所使用的解碼器
484
		#影片檔案位置,類型,所使用的解碼器
485
		$result["content"]=$result["content"]."<source src=\"".$conf["videoFilePosition"]."\" type=\"video/webm\" />";
485
		$result["content"]=$result["content"]."<source src=\"".$conf["videoFilePosition"]."\" type=\"video/webm\" />";
486
		$base64data=$base64data."<source src=\"".$conf["videoFilePosition"]."\" type=\"video/webm\" />";
486
		$base64data=$base64data."<source src=\"".$conf["videoFilePosition"]."\" type=\"video/webm\" />";
487
 
487
 
488
		#語法結束
488
		#語法結束
489
		$result["content"]=$result["content"]."</video>";	
489
		$result["content"]=$result["content"]."</video>";
490
		$base64data=$base64data."</video>";
490
		$base64data=$base64data."</video>";
491
		
491
 
492
		#取得用base64加密影片後的影片放置語法
492
		#取得用base64加密影片後的影片放置語法
493
		$result["base64data"]=$base64data;
493
		$result["base64data"]=$base64data;
494
		
494
 
495
		#設置執行正常
495
		#設置執行正常
496
		$result["status"]="true";
496
		$result["status"]="true";
497
		
497
 
498
		#回傳語法
498
		#回傳語法
499
		return $result;
499
		return $result;
500
			
500
 
501
		}#function html5 end
501
		}#function html5 end
502
		
502
 
503
	}#class video end
503
	}#class video end
504
	
504
 
505
?>
505
?>