Contents↶
- Introduction
- Browser Support
- Installation
- Usage
- ShortKey
- Todo
- Contributing
- Coding Style
- History
- License
Introduction↶
這是2016年暑假,我在系上實習,老師叫我們做的系統,我用去年寫的播放器加以改進。 最新版本為0.3.1。
Browser Support↶
IE 9+ ✔ | Chrome ✔ | Firefox ✔ | Opera 37.0+ ✔ | Safari 4.0+ ✖ | Vivaldi 1+ ✔ |
Installation↶
注意: 本專案使用的是Python3
要勾"Add Python to PATH",把Python加到環境變數中。
-
Clone the repository
Use command:
git clone https://github.com/TCCinTaiwan/TcTube
Or:
-
Install requirement python module
You can use pip:
pip install pip --upgrade pip install -r TcTube/requirements.txt
Or you can run setup.py :
python setup.py install
-
下載nginx後,把檔案放在TcTube底下,或者修改 main.py 中nginx路徑。
最好下載最新的穩定版本(Stable version)
- 把 setup/nginx-main.conf複製到主要伺服器 nginx-*/conf/ 底下,取代原本的 nginx.conf。
假如是Ubuntu要執行則是取代/etc/nginx/nginx.conf,還要修改路徑,其他系統以此類推。
-
把 setup/nginx-substation.conf複製到次要伺服器 nginx-*/conf/ 底下,取代原本的 nginx.conf。
-
修改主要伺服器nginx.conf檔案的upstream伺服器列表(Port要正確)。
- 音樂檔案要放在 file/video/
- 修改 database.db裡的videos和videoSources資料表,加入自己的歌
- 略縮圖要放在 file/image/streamshot
insert into videos (title, artist) values ("<title>", "<artist>");
insert into videoSources (id, video_id, source) values (1, <video_id>, "<filename>");
insert into videoSources (id, video_id, source) values (2, <video_id>, "<filename2>");
...
Usage↶
- run Server:
# Go into the directory
cd TcTube
# run server
python main.py
Make sure port 80, 8000, 8080 (TCP) is open.
ShortKey↶
- Ctrl + ←: 上一首
- Ctrl + →: 下一首
- Shift 滾輪: 播放速度
- ←: 往前
- →: 往後
- +: 增加音量
- -: 減少音量
- Space: 播放/暫停
- 0: 跳到影片開頭
- 1: 跳到影片10%位置
- 2: 跳到影片20%位置
- 3: 跳到影片30%位置
- 4: 跳到影片40%位置
- 5: 跳到影片50%位置
- 6: 跳到影片60%位置
- 7: 跳到影片70%位置
- 8: 跳到影片80%位置
- 9: 跳到影片90%位置
Todo↶
- 資料庫:
- 部門
- select users.id, users.account, users.password, users.name , users.affiliation, department.name as affiliation_name, users.email, users.phone, users.birthday, users.creating_time, users.login_time, users.login_ip, users.competence from users join department on users.affiliation = department.id;
- 部門
- 控制面板延遲
- APP化
- 頁面歷史
- 播放清單
- 影片嵌入支援
- Vimeo.com
- 優酷 http://open.youku.com/tools
- 土豆網
- 愛奇藝
- FaceBook https://developers.facebook.com/docs/plugins/embedded-video-player
- flv
- Seek影片預覽
- SSL
- 選項:
- 下載檔名格式
- 檔案類型分析(不是以副檔名分析)
- Blob
- 時間進度Seekable
- SSO
- localization:
- Babel
- 加入uwsgi
- 播放器重構
- Chrome Extensions
- Youtube跟Video整合:
- 斷線時跳過
- Youtube斷線時使用本地
- 修復上傳功能
Contributing↶
- Create an issue and describe your idea
- it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a Pull Request
Coding Style↶
JavaScript↶
- No tabs. Four spaces.
- No trailing whitespace.
- Always use semicolons and don't rely on implicit insertion.
- use lowerCamelCase for identifier names (variables and functions).
- ✅ good
var helloWorld = "Hello, world."; // lowerCamelCase var strHelloWorld = "Hello, world."; // Hungarian Notation + lowerCamelCase
- ❌ bad
var HelloWorld = "Hello, world."; // UpperCamelCase, Pascal var helloworld = "Hello, world."; // lowercase var HELLOWORLD = "Hello, world."; // UPPERCASE var Hello_World = "Hello, world."; // Capitalized_Words_With_Underscores var HELLO_WORLD = "Hello, world."; // UPPER_CASE_WITH_UNDERSCORES var hello_world = "Hello, world."; // lower_case_with_underscores var hello-world = "Hello, world."; // lower-case-hyphens var HELLO-WORLD = "Hello, world."; // UPPER-CASE-HYPHENS ...
- Double quotes. Single quotes are OK only when nested within double quotes.
- ✅ good
var foo = "Hello, world."; var bar = "Hello, 'world.'";
- ❌ bad
var foo = 'Hello, world.';
- Functions are followed by no space.
- ✅ good
function foo() { ... }
- ❌ bad
function foo () { ... }
- Always put spaces around operators (= + - * /), and after commas.
- ✅ good
var x = y + z; var values = ["Apple", "Ball", "Cat"];
- ❌ bad
var x=y+z; var values=["Apple","Ball","Cat"];
- Argument definitions are followed by no spaces.
- ✅ good
function foo(a, b, c) { ... }
- ❌ bad
function foo( a, b, c ) { ... }
- A single space will always and should only follow semi-colons when defining object literals.
- ✅ good
var foo = { bar: 1 };
- ❌ bad
var foo = { bar : 1 }; var foo = { bar:1 };
- A single space will always follow conditional statements.
- ✅ good
if (true) { ... }
- ❌ bad
if(true) { ... } if(true){ ... }
- General rules for complex (compound) statements:
- Put the opening bracket at the end of the first line.
- Use one space before the opening bracket.
- Put the closing bracket on a new line, without leading spaces.
- Do not end a complex statement with a semicolon.
function formatTime(seconds) { minutes = Math.floor(seconds / 60); minutes = (minutes >= 10) ? minutes : "0" + minutes; seconds = Math.floor(seconds % 60); seconds = (seconds >= 10) ? seconds : "0" + seconds; return minutes + ":" + seconds; }
History↶
For detailed changelog, check Change Log.