+4
-1
@@ -6,4 +6,7 @@ node_js:
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
- node_modules
|
||||
|
||||
script:
|
||||
yarn run build
|
||||
|
||||
+5
-5
@@ -51,7 +51,7 @@ function initPlayers () {
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/'
|
||||
api: 'https://api.prprpr.me/dplayer/'
|
||||
}
|
||||
});
|
||||
// dp1
|
||||
@@ -69,7 +69,7 @@ function initPlayers () {
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/'
|
||||
api: 'https://api.prprpr.me/dplayer/'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -100,7 +100,7 @@ function initPlayers () {
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
token: 'tokendemo',
|
||||
maximum: 3000,
|
||||
user: 'DIYgod',
|
||||
@@ -249,7 +249,7 @@ function switchDPlayer () {
|
||||
type: 'auto',
|
||||
}, {
|
||||
id: '5rGf5Y2X55qu6Z2p',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
maximum: 3000,
|
||||
user: 'DIYgod'
|
||||
});
|
||||
@@ -261,7 +261,7 @@ function switchDPlayer () {
|
||||
type: 'auto'
|
||||
}, {
|
||||
id: '9E2E3368B56CDBB42',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
maximum: 3000,
|
||||
user: 'DIYgod'
|
||||
});
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+7
-7
@@ -55,7 +55,7 @@ const dp = new DPlayer({
|
||||
},
|
||||
danmaku: {
|
||||
id: 'demo',
|
||||
api: 'https://api.prprpr.me/dplayer3/'
|
||||
api: 'https://api.prprpr.me/dplayer/'
|
||||
}
|
||||
});
|
||||
```
|
||||
@@ -146,10 +146,10 @@ const dp = new DPlayer({
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
token: 'tokendemo',
|
||||
maximum: 1000,
|
||||
addition: ['https://api.prprpr.me/dplayer3/bilibili?aid=4157142'],
|
||||
addition: ['https://api.prprpr.me/dplayer/v3/bilibili?aid=4157142'],
|
||||
user: 'DIYgod',
|
||||
bottom: '15%',
|
||||
unlimited: true
|
||||
@@ -204,7 +204,7 @@ const dp = new DPlayer({
|
||||
thumbnails: 'second.jpg'
|
||||
}, {
|
||||
id: 'test',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
maximum: 3000,
|
||||
user: 'DIYgod'
|
||||
});
|
||||
@@ -385,7 +385,7 @@ const dp = new DPlayer({
|
||||
|
||||
**Ready-made API**
|
||||
|
||||
url: https://api.prprpr.me/dplayer3/
|
||||
url: https://api.prprpr.me/dplayer/
|
||||
|
||||
Daily backup data: [DPlayer-data](https://github.com/DIYgod/DPlayer-data)
|
||||
|
||||
@@ -397,13 +397,13 @@ Daily backup data: [DPlayer-data](https://github.com/DIYgod/DPlayer-data)
|
||||
|
||||
`danmaku.addition`
|
||||
|
||||
API: [https://api.prprpr.me/dplayer3/v2/bilibili?aid=[aid]](https://api.prprpr.me/dplayer3/v2/bilibili?aid=[aid]) or [https://api.prprpr.me/dplayer3/v2/bilibili?cid=[cid]](https://api.prprpr.me/dplayer3/v2/bilibili?cid=[cid])
|
||||
API: <https://api.prprpr.me/dplayer/v3/bilibili?aid=[aid]>
|
||||
|
||||
```js
|
||||
const option = {
|
||||
danmaku: {
|
||||
// ...
|
||||
addition: ['https://api.prprpr.me/dplayer3/v2/bilibili?aid=[aid]']
|
||||
addition: ['https://api.prprpr.me/dplayer/v3/bilibili?aid=[aid]']
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
+15
-5
@@ -82,13 +82,13 @@ function dplayer1 () {
|
||||
window.dp1 = new DPlayer({
|
||||
container: document.getElementById('dplayer1'),
|
||||
video: {
|
||||
url: 'https://pan.prprpr.me/?/dplayer/hikarunara.mp4',
|
||||
url: 'https://api.dogecloud.com/player/get.mp4?vcode=5ac682e6f8231991&userId=17&ext=.mp4',
|
||||
pic: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.png',
|
||||
thumbnails: 'https://moeplayer.b0.upaiyun.com/dplayer/hikarunara_thumbnails.jpg'
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/'
|
||||
api: 'https://api.prprpr.me/dplayer/'
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -107,7 +107,7 @@ function dplayer2 () {
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/'
|
||||
api: 'https://api.prprpr.me/dplayer/'
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -140,10 +140,10 @@ function dplayer3 () {
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
token: 'tokendemo',
|
||||
maximum: 1000,
|
||||
addition: ['https://api.prprpr.me/dplayer3/bilibili?aid=4157142'],
|
||||
addition: ['https://api.prprpr.me/dplayer/v3/bilibili?aid=4157142'],
|
||||
user: 'DIYgod',
|
||||
bottom: '15%',
|
||||
unlimited: true
|
||||
@@ -159,6 +159,16 @@ function dplayer3 () {
|
||||
console.log(player);
|
||||
}
|
||||
}
|
||||
],
|
||||
highlight: [
|
||||
{
|
||||
time: 20,
|
||||
text: '这是第 20 秒'
|
||||
},
|
||||
{
|
||||
time: 120,
|
||||
text: '这是 2 分钟'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
+4
-4
@@ -5,8 +5,8 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
|
||||
<title>DPlayer</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docute/dist/docute.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docute/dist/theme-github.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docute@3.4.12/dist/docute.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docute@3.4.12/dist/theme-github.css" />
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-48084758-9"></script>
|
||||
<script>
|
||||
@@ -38,9 +38,9 @@
|
||||
<body>
|
||||
<!-- don't remove this part start -->
|
||||
<div id="app"></div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docute/plugins/docsearch.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docute@3.4.12/plugins/docsearch.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docute-evanyou/dist/evanyou.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docute/dist/docute.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docute@3.4.12/dist/docute.js"></script>
|
||||
<script src="./config.js"></script>
|
||||
<!-- livereload script placeholder -->
|
||||
<!-- don't remove this part end -->
|
||||
|
||||
@@ -56,7 +56,7 @@ const dp = new DPlayer({
|
||||
},
|
||||
danmaku: {
|
||||
id: 'demo',
|
||||
api: 'https://api.prprpr.me/dplayer3/'
|
||||
api: 'https://api.prprpr.me/dplayer/'
|
||||
}
|
||||
});
|
||||
```
|
||||
@@ -147,10 +147,10 @@ const dp = new DPlayer({
|
||||
},
|
||||
danmaku: {
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
token: 'tokendemo',
|
||||
maximum: 1000,
|
||||
addition: ['https://api.prprpr.me/dplayer3/bilibili?aid=4157142'],
|
||||
addition: ['https://api.prprpr.me/dplayer/v3/bilibili?aid=4157142'],
|
||||
user: 'DIYgod',
|
||||
bottom: '15%',
|
||||
unlimited: true
|
||||
@@ -205,7 +205,7 @@ const dp = new DPlayer({
|
||||
thumbnails: 'second.jpg'
|
||||
}, {
|
||||
id: 'test',
|
||||
api: 'https://api.prprpr.me/dplayer3/',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
maximum: 3000,
|
||||
user: 'DIYgod'
|
||||
});
|
||||
@@ -382,7 +382,7 @@ const dp = new DPlayer({
|
||||
|
||||
**现成的接口**
|
||||
|
||||
链接: https://api.prprpr.me/dplayer3/
|
||||
链接: https://api.prprpr.me/dplayer/
|
||||
|
||||
每日备份: [DPlayer-data](https://github.com/DIYgod/DPlayer-data)
|
||||
|
||||
@@ -394,13 +394,13 @@ const dp = new DPlayer({
|
||||
|
||||
`danmaku.addition`
|
||||
|
||||
API: [https://api.prprpr.me/dplayer3/v2/bilibili?aid=[aid]](https://api.prprpr.me/dplayer3/v2/bilibili?aid=[aid]) or [https://api.prprpr.me/dplayer3/v2/bilibili?cid=[cid]](https://api.prprpr.me/dplayer3/v2/bilibili?cid=[cid])
|
||||
API: <https://api.prprpr.me/dplayer/v3/bilibili?aid=[aid]>
|
||||
|
||||
```js
|
||||
const option = {
|
||||
danmaku: {
|
||||
// ...
|
||||
addition: ['https://api.prprpr.me/dplayer3/v2/bilibili?aid=[aid]']
|
||||
addition: ['https://api.prprpr.me/dplayer/v3/bilibili?aid=[aid]']
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dplayer",
|
||||
"version": "1.24.0",
|
||||
"version": "1.25.0",
|
||||
"description": "Wow, such a lovely HTML5 danmaku video player",
|
||||
"main": "dist/DPlayer.min.js",
|
||||
"style": "dist/DPlayer.min.css",
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
&~.dplayer-bar-preview {
|
||||
opacity: 0;
|
||||
},
|
||||
}
|
||||
&~.dplayer-bar-time {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
+10
-3
@@ -1,18 +1,23 @@
|
||||
class ContextMenu {
|
||||
constructor (player) {
|
||||
this.player = player;
|
||||
this.shown = false;
|
||||
|
||||
[...this.player.template.menuItem].map((item, index) => {
|
||||
Array.prototype.slice.call(this.player.template.menuItem).forEach((item, index) => {
|
||||
if (this.player.options.contextmenu[index].click) {
|
||||
item.addEventListener('click', () => {
|
||||
this.player.options.contextmenu[index].click(this.player);
|
||||
this.hide();
|
||||
});
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
this.player.container.addEventListener('contextmenu', (e) => {
|
||||
if (this.shown) {
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
const event = e || window.event;
|
||||
event.preventDefault();
|
||||
|
||||
@@ -48,6 +53,7 @@ class ContextMenu {
|
||||
|
||||
this.player.template.mask.classList.add('dplayer-mask-show');
|
||||
|
||||
this.shown = true;
|
||||
this.player.events.trigger('contextmenu_show');
|
||||
}
|
||||
|
||||
@@ -55,8 +61,9 @@ class ContextMenu {
|
||||
this.player.template.mask.classList.remove('dplayer-mask-show');
|
||||
this.player.template.menu.classList.remove('dplayer-menu-show');
|
||||
|
||||
this.shown = false;
|
||||
this.player.events.trigger('contextmenu_hide');
|
||||
}
|
||||
}
|
||||
|
||||
export default ContextMenu;
|
||||
export default ContextMenu;
|
||||
|
||||
@@ -57,13 +57,13 @@ class Controller {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
initHighlights () {
|
||||
this.player.on('durationchange', () => {
|
||||
if (this.player.video.duration !== 1 && this.player.video.duration !== Infinity) {
|
||||
if (this.player.options.highlight) {
|
||||
const highlights = document.querySelectorAll('.dplayer-highlight');
|
||||
[].slice.call(highlights, 0).map((item) => {
|
||||
[].slice.call(highlights, 0).forEach((item) => {
|
||||
this.player.template.playedBarWrap.removeChild(item);
|
||||
});
|
||||
for (let i = 0; i < this.player.options.highlight.length; i++) {
|
||||
@@ -72,7 +72,7 @@ class Controller {
|
||||
}
|
||||
const p = document.createElement('div');
|
||||
p.classList.add('dplayer-highlight');
|
||||
p.style.left = ( (this.player.options.highlight[i].time / this.player.video.duration) * 100) + '%';
|
||||
p.style.left = this.player.options.highlight[i].time / this.player.video.duration * 100 + '%';
|
||||
p.innerHTML = '<span class="dplayer-highlight-text">' + this.player.options.highlight[i].text + '</span>';
|
||||
this.player.template.playedBarWrap.insertBefore(p, this.player.template.playedBarTime);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class FullScreen {
|
||||
utils.setScrollPosition(this.lastScrollPosition);
|
||||
this.player.events.trigger('fullscreen_cancel');
|
||||
}
|
||||
}
|
||||
};
|
||||
if (/Firefox/.test(navigator.userAgent)) {
|
||||
document.addEventListener('mozfullscreenchange', docfullscreenchange);
|
||||
document.addEventListener('fullscreenchange', docfullscreenchange);
|
||||
|
||||
+13
-13
@@ -61,35 +61,35 @@ const tranTxt = {
|
||||
'Video info': '视频统计信息',
|
||||
},
|
||||
'zh-tw' : {
|
||||
'Danmaku is loading': '彈幕加載中',
|
||||
'Danmaku is loading': '彈幕載入中',
|
||||
'Top': '頂部',
|
||||
'Bottom': '底部',
|
||||
'Rolling': '滾動',
|
||||
'Input danmaku, hit Enter': '輸入彈幕,Enter 發送',
|
||||
'About author': '關於作者',
|
||||
'DPlayer feedback': '播放器意見反饋',
|
||||
'DPlayer feedback': '播放器意見回饋',
|
||||
'About DPlayer': '關於 DPlayer 播放器',
|
||||
'Loop': '循環播放',
|
||||
'Speed': '速度',
|
||||
'Opacity for danmaku': '彈幕透明度',
|
||||
'Normal': '正常',
|
||||
'Please input danmaku content!': '請輸入彈幕内容啊!',
|
||||
'Set danmaku color': '設置彈幕顏色',
|
||||
'Set danmaku type': '設置彈幕類型',
|
||||
'Please input danmaku content!': '請輸入彈幕內容啊!',
|
||||
'Set danmaku color': '設定彈幕顏色',
|
||||
'Set danmaku type': '設定彈幕類型',
|
||||
'Show danmaku': '顯示彈幕',
|
||||
'Video load failed': '視頻加載失敗',
|
||||
'Danmaku load failed': '彈幕加載失敗',
|
||||
'Video load failed': '影片載入失敗',
|
||||
'Danmaku load failed': '彈幕載入失敗',
|
||||
'Danmaku send failed': '彈幕發送失敗',
|
||||
'Switching to': '正在切換至',
|
||||
'Switched to': '已經切換至',
|
||||
'quality': '畫質',
|
||||
'FF': '快進',
|
||||
'REW': '快退',
|
||||
'Unlimited danmaku': '海量彈幕',
|
||||
'Unlimited danmaku': '巨量彈幕',
|
||||
'Send danmaku': '發送彈幕',
|
||||
'Setting': '設置',
|
||||
'Full screen': '全屏',
|
||||
'Web full screen': '頁面全屏',
|
||||
'Setting': '設定',
|
||||
'Full screen': '全螢幕',
|
||||
'Web full screen': '頁面全螢幕',
|
||||
'Send': '發送',
|
||||
'Screenshot': '截圖',
|
||||
's': '秒',
|
||||
@@ -97,8 +97,8 @@ const tranTxt = {
|
||||
'Hide subtitle': '隱藏字幕',
|
||||
'Volume': '音量',
|
||||
'Live': '直播',
|
||||
'Video info': '視頻統計信息',
|
||||
'Video info': '影片統計訊息',
|
||||
}
|
||||
};
|
||||
|
||||
export default i18n;
|
||||
export default i18n;
|
||||
|
||||
+1
-1
@@ -438,7 +438,7 @@ class DPlayer {
|
||||
this.on('error', () => {
|
||||
if (!this.video.error) {
|
||||
// Not a video load error, may be poster load failed, see #307
|
||||
return
|
||||
return;
|
||||
}
|
||||
this.tran && this.notice && this.type !== 'webtorrent' & this.notice(this.tran('Video load failed'), -1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user