This commit is contained in:
DIYgod 2016-07-20 14:45:26 +08:00
parent 69cdabae3a
commit 621b7b16ed
No known key found for this signature in database
GPG Key ID: F8797DD1088C6506
4 changed files with 13 additions and 11 deletions

View File

@ -49,10 +49,10 @@ var option = {
autoplay: false, // Optional, autoplay video, not supported by mobile browsers
theme: '#FADFA3', // Optional, theme color, default: #b7daff
loop: true, // Optional, loop play music, default: true
lang: 'zh', // Optional, language, `zh` for Chinese, `en` for English, default: en
lang: 'zh', // Optional, language, `zh` for Chinese, `en` for English, default: Navigator language
video: { // Required, video info
url: '若能绽放光芒.mp4', // Required, video url
pic: '若能绽放光芒.png' // Optional, music picture
url: '若能绽放光芒.mp4', // Required, video url
pic: '若能绽放光芒.png' // Optional, music picture
},
danmaku: { // Optional, showing danmaku
id: '9E2E3368B56CDBB4', // Required, danmaku id, MUST BE UNIQUE, CAN NOT USE THESE IN YOUR NEW PLAYER: `https://dplayer.daoapp.io/list`

6
dist/DPlayer.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -46,7 +46,7 @@ class DPlayer {
autoplay: false,
theme: '#b7daff',
loop: false,
lang: 'en'
lang: navigator.language.indexOf('zh') !== -1 ? 'zh' : 'en'
};
for (let defaultKey in defaultOption) {
if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {
@ -70,7 +70,9 @@ class DPlayer {
'Speed': '速度',
'Opacity for danmaku': '弹幕透明度',
'Normal': '正常',
'Please input danmaku!': '要输入弹幕内容啊喂!'
'Please input danmaku!': '要输入弹幕内容啊喂!',
'Set danmaku color': '设置弹幕颜色',
'Set danmaku type': '设置弹幕类型'
};
this.getTran = (text) => {
if (this.option.lang === 'en') {
@ -205,7 +207,7 @@ class DPlayer {
+ ` </button>
<div class="dplayer-comment-setting-box">
<div class="dplayer-comment-setting-color">
<div class="dplayer-comment-setting-title">设置弹幕颜色</div>
<div class="dplayer-comment-setting-title">${this.getTran('Set danmaku color')}</div>
<label>
<input type="radio" name="dplayer-danmaku-color" value="#fff" checked>
<span style="background: #fff; border: 1px solid rgba(0,0,0,.1);"></span>
@ -232,7 +234,7 @@ class DPlayer {
</label>
</div>
<div class="dplayer-comment-setting-type">
<div class="dplayer-comment-setting-title">设置弹幕类型</div>
<div class="dplayer-comment-setting-title">${this.getTran('Set danmaku type')}</div>
<label>
<input type="radio" name="dplayer-danmaku-type" value="top">
<span>${this.getTran('Top')}</span>