use promise and object.assign polyfill
This commit is contained in:
parent
cda90989b2
commit
e26f78eed2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "dplayer",
|
||||
"version": "1.20.0",
|
||||
"version": "1.20.1",
|
||||
"description": "Wow, such a lovely HTML5 danmaku video player",
|
||||
"main": "dist/DPlayer.min.js",
|
||||
"style": "dist/DPlayer.min.css",
|
||||
|
|
@ -53,6 +53,8 @@
|
|||
"webpack-dev-server": "^2.9.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"balloon-css": "^0.5.0"
|
||||
"balloon-css": "^0.5.0",
|
||||
"object-assign": "4.1.1",
|
||||
"promise-polyfill": "7.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* global DPLAYER_VERSION GIT_HASH */
|
||||
import objectAssign from 'object-assign';
|
||||
import defaultApiBackend from './api.js';
|
||||
|
||||
export default (options) => {
|
||||
|
|
@ -116,7 +117,7 @@ export default (options) => {
|
|||
}
|
||||
|
||||
if (options.icons) {
|
||||
options.icons = Object.assign({}, defaultOption.icons, options.icons);
|
||||
options.icons = objectAssign({}, defaultOption.icons, options.icons);
|
||||
}
|
||||
|
||||
options.contextmenu = options.contextmenu.concat([
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import Promise from 'promise-polyfill';
|
||||
|
||||
import utils from './utils';
|
||||
import handleOption from './options';
|
||||
import i18n from './i18n';
|
||||
|
|
@ -175,15 +177,11 @@ class DPlayer {
|
|||
|
||||
this.template.playButton.innerHTML = this.icons.get('pause');
|
||||
|
||||
const playedPromise = this.video.play();
|
||||
if (playedPromise) {
|
||||
playedPromise.
|
||||
catch(() => {
|
||||
this.pause();
|
||||
}).
|
||||
then(() => {
|
||||
});
|
||||
}
|
||||
const playedPromise = Promise.resolve(this.video.play());
|
||||
playedPromise.catch(() => {
|
||||
this.pause();
|
||||
}).then(() => {
|
||||
});
|
||||
this.time.enable();
|
||||
this.container.classList.add('dplayer-playing');
|
||||
if (this.danmaku) {
|
||||
|
|
|
|||
|
|
@ -3358,7 +3358,7 @@ oauth-sign@~0.8.1, oauth-sign@~0.8.2:
|
|||
version "0.8.2"
|
||||
resolved "http://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
|
||||
|
||||
object-assign@^4.0.1, object-assign@^4.1.0:
|
||||
object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "http://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
|
||||
|
|
@ -3920,6 +3920,10 @@ progress@^2.0.0:
|
|||
version "2.0.0"
|
||||
resolved "http://registry.npm.taobao.org/progress/download/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
|
||||
|
||||
promise-polyfill@7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "http://registry.npm.taobao.org/promise-polyfill/download/promise-polyfill-7.0.0.tgz#c665b6da1f97e21c3f2f7aa0543c90209127cb15"
|
||||
|
||||
proxy-addr@~2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "http://registry.npm.taobao.org/proxy-addr/download/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
|
||||
|
|
|
|||
Loading…
Reference in New Issue