UNPKG

527 BJavaScriptView Raw
1import { unbindEvents } from '../internal/events.js';
2import pause from '../internal/pause.js';
3
4/* eslint-disable no-invalid-this */
5export default function() {
6 if (!this.container) {
7 return this;
8 }
9
10 pause.call(this);
11 this.clear();
12 this.container.removeChild(this._.stage);
13 if (this.media) {
14 unbindEvents.call(this, this._.listener);
15 }
16 for (var key in this) {
17 /* istanbul ignore else */
18 if (Object.prototype.hasOwnProperty.call(this, key)) {
19 this[key] = null;
20 }
21 }
22 return this;
23}