use promise and object.assign polyfill
This commit is contained in:
+2
-1
@@ -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([
|
||||
|
||||
+7
-9
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user