Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 545 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
362 liveuser 1
<?php
2
 
3
/*
4
 
5
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2023 Min-Jhin,Chen
7
 
8
    This file is part of QBPWCF.
9
 
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
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
*/
24
 
25
#使用 qbpwcf 命名空間
26
namespace qbpwcf;
27
 
28
#匯入套件
29
require_once("qbpwcf/allInOne.php");
30
 
31
#建議的log位置
32
$logFile=$_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"].".log";
33
 
34
#函式說明:
35
#放置html5支援的webm格式影片(webm),結果會回傳語法.
36
#回傳結果:
37
#$result["status"],執行正常與否,"true"代表正常;"false"代表不正常.
38
#$result["error"],錯誤訊息陣列.
39
#$result["function"],當前函數名稱.
40
#$result["content"],放置html5支援的webm格式影片語法.
41
#$result["base64data"],用base64加密影片後放置html5支援的webm格式影片語法.
42
#必填參數:
43
#$conf["videoFilePosition"],字串,爲影片的路徑,需要有附檔名.
44
$conf["videoFilePosition"]="assets of video/big-buck-bunny_trailer.webm";
45
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑.
46
$conf["fileArgu"]=__FILE__;
47
#可省略參數:
48
#$conf["width"],字串,爲影片的寬度,預設不設置.
49
#$conf["width"]="";
50
#$conf["height"],字串,爲影片的高度,預設不設置.
51
#$conf["height"]="";
52
#$conf["codecs"],字串,爲解碼器名稱,預設爲 "vp8, vorbis"
53
#$conf["codecs"]="vp8, vorbis"
54
#$conf["autoplay"],字串,為是否要自動播放,"true"代表要,"false"代表不要,預設為"false".
55
$conf["autoplay"]="true";
56
#$conf["loop"],字串,爲是否重複播放,若要重複播放則應填入 "true" ,預設爲不重複
57
#$conf["loop"]="false";
58
#$conf["controlls"],字串,是否要顯示控制面板,預設為"false"不顯示;反之為"true"要顯示.
59
#$conf["controlls"]="true";
60
#$conf["class"],字串,要套用的css類別樣式名稱.
61
#$conf["class"]="";
62
#參考資料:
63
#無.
64
#備註:
65
#建議增加影片載入完畢就自動播放的js.
66
$html5=video::html5($conf);
67
unset($conf);
68
 
69
#如果執行失敗
70
if($html5["status"]==="false")
71
{
72
	#函式說明:
73
	#撰寫log
74
	#回傳結果:
75
	#$result["status"],狀態,"true"或"false".
76
	#$result["error"],錯誤訊息陣列.
77
	#$result["function"],當前函式的名稱.
78
	#$result["argu"],使用的參數.
79
	#必填參數:
80
	#$conf["path"],字串,log檔案的路徑與名稱.
81
	$conf["path"]=$logFile;
82
	#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
83
	$conf["content"]=$html5;
84
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
85
	$conf["fileArgu"]=__FILE__;
86
	#可省略參數:
87
	#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
88
	#$conf["rewrite"]="false";
89
	#參考資料:
90
	#無.
91
	#備註:
92
	#無.
93
	$record=logs::record($conf);
94
	unset($conf);
95
 
545 liveuser 96
	#如果寫log失敗
97
	if($record["status"]==="false"){
98
 
99
		#印出結果
100
		var_dump($record);
101
 
102
		}#if end
103
 
104
	#結束執行,回傳錯誤代碼1
105
	exit(1);
362 liveuser 106
}
107
 
108
#印出結果
109
echo $html5["content"];
110
 
111
?>