update common code

This commit is contained in:
Harvey Zack committed 2018-10-12 17:16:49 +08:00
1 parent 495782f5c6
commit 11bc295663
14 files changed
+59 -44

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
export default class Contextmenu {
constructor({ option }) {
//
constructor(art) {
this.art = art;
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
export default class Danmu {
constructor({ option }) {
//
constructor(art) {
this.art = art;
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
export default class Events {
constructor({ option }) {
//
constructor(art) {
this.art = art;
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
export default class Hotkey {
constructor({ option }) {
//
constructor(art) {
this.art = art;
}
}
+2
View File
@@ -12,6 +12,7 @@ import Info from './info';
import Subtitle from './subtitle';
import Events from './events';
import Hotkey from './hotkey';
import Layers from './layers';
let id = 0;
export const instances = [];
@@ -77,6 +78,7 @@ class Artplayer extends Emitter {
this.info = new Info(this);
this.events = new Events(this);
this.hotkey = new Hotkey(this);
this.layers = new Layers(this);
this.id = id++;
instances.push(this);
+2 -2
View File
@@ -1,5 +1,5 @@
export default class Info {
constructor({ option }) {
//
constructor(art) {
this.art = art;
}
}
+5
View File
@@ -0,0 +1,5 @@
export default class Layers {
constructor(art) {
this.art = art;
}
}
-1
View File
@@ -85,7 +85,6 @@ export default class Mse {
this.art.on('mediaSource:sourceopen', () => {
this.sourceBuffer = this.mediaSource.addSourceBuffer(option.mimeCodec);
sourceBuffer.events.forEach(eventName => {
this.sourceBuffer.addEventListener(eventName, this.sourceBufferEventFn);
this.art.destroyEvents.push(() => {
+3 -3
View File
@@ -1,5 +1,5 @@
export default class Captions {
constructor({ option }) {
//
export default class Subtitle {
constructor(art) {
this.art = art;
}
}
+4 -2
View File
@@ -1,7 +1,9 @@
export default class ArtPlayerError extends Error {
constructor(message) {
constructor(message, context) {
super(message);
Error.captureStackTrace(this, this.constructor);
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, context || this.constructor);
}
this.name = 'ArtPlayerError';
}
}