export default class VideoTool { static get toolbox() { return { icon: ``, title: 'Video', }; } constructor({ data, api, config }) { this.data = data || {}; this.api = api; this.config = config || {}; this.wrapper = null; this.alignment = data.alignment || 'center'; this.width = data.width || '100%'; // Привязываем контекст для обработчиков this._handleFileUpload = this._handleFileUpload.bind(this); this._initResize = this._initResize.bind(this); this._handleUrlSubmit = this._handleUrlSubmit.bind(this); // Added this binding } render() { this.wrapper = document.createElement('div'); this.wrapper.classList.add('video-tool'); if (this.data.url) { this._createVideoElement(this.data.url, this.data.caption || ''); } else { this._createUploadForm(); } return this.wrapper; } _createUploadForm() { this.wrapper.innerHTML = `