mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
refactor(packages)!: replace DelegateMixin & ProxyMixin with MediaHost base classes (#1292)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// Core
|
||||
export { DelegateMixin } from '@videojs/core';
|
||||
export * from '@videojs/core/dom';
|
||||
|
||||
// Store
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
import { DashCustomMedia, DashMediaDelegate } from '@videojs/core/dom/media/dash';
|
||||
import { CustomMediaElement } from '@videojs/core/dom/media/custom-media-element';
|
||||
import { DashMedia } from '@videojs/core/dom/media/dash';
|
||||
import { MediaAttachMixin } from '../../store/media-attach-mixin';
|
||||
import { MediaPropsMixin } from '../../utils/media-props-mixin';
|
||||
|
||||
export class DashVideo extends MediaPropsMixin(MediaAttachMixin(DashCustomMedia), DashMediaDelegate) {
|
||||
constructor() {
|
||||
super();
|
||||
this.attach(this.target);
|
||||
}
|
||||
|
||||
disconnectedCallback(): void {
|
||||
super.disconnectedCallback?.();
|
||||
|
||||
if (!this.hasAttribute('keep-alive')) {
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
export class DashVideo extends MediaAttachMixin(CustomMediaElement('video', DashMedia)) {}
|
||||
|
||||
@@ -1,22 +1,5 @@
|
||||
import { HlsCustomMedia, HlsMediaDelegate } from '@videojs/core/dom/media/hls';
|
||||
import { CustomMediaElement } from '@videojs/core/dom/media/custom-media-element';
|
||||
import { HlsMedia } from '@videojs/core/dom/media/hls';
|
||||
import { MediaAttachMixin } from '../../store/media-attach-mixin';
|
||||
import { MediaPropsMixin } from '../../utils/media-props-mixin';
|
||||
|
||||
export class HlsVideo extends MediaPropsMixin(MediaAttachMixin(HlsCustomMedia), HlsMediaDelegate) {
|
||||
constructor() {
|
||||
super();
|
||||
// TODO: If we like to support native media elements that
|
||||
// are appended after the custom element is created, we need to
|
||||
// attach the native element to the Media API after the native element
|
||||
// is appended to the DOM. This is currently not supported.
|
||||
this.attach(this.target);
|
||||
}
|
||||
|
||||
disconnectedCallback(): void {
|
||||
super.disconnectedCallback?.();
|
||||
|
||||
if (!this.hasAttribute('keep-alive')) {
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
export class HlsVideo extends MediaAttachMixin(CustomMediaElement('video', HlsMedia)) {}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
import { MuxCustomAudio, MuxMediaDelegate } from '@videojs/core/dom/media/mux';
|
||||
import { CustomMediaElement } from '@videojs/core/dom/media/custom-media-element';
|
||||
import { MuxAudioMedia } from '@videojs/core/dom/media/mux';
|
||||
import { MediaAttachMixin } from '../../store/media-attach-mixin';
|
||||
import { MediaPropsMixin } from '../../utils/media-props-mixin';
|
||||
|
||||
export class MuxAudio extends MediaPropsMixin(MediaAttachMixin(MuxCustomAudio), MuxMediaDelegate) {
|
||||
constructor() {
|
||||
super();
|
||||
this.attach(this.target);
|
||||
}
|
||||
|
||||
disconnectedCallback(): void {
|
||||
super.disconnectedCallback?.();
|
||||
|
||||
if (!this.hasAttribute('keep-alive')) {
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
export class MuxAudio extends MediaAttachMixin(CustomMediaElement('audio', MuxAudioMedia)) {}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
import { MuxCustomVideo, MuxMediaDelegate } from '@videojs/core/dom/media/mux';
|
||||
import { CustomMediaElement } from '@videojs/core/dom/media/custom-media-element';
|
||||
import { MuxVideoMedia } from '@videojs/core/dom/media/mux';
|
||||
import { MediaAttachMixin } from '../../store/media-attach-mixin';
|
||||
import { MediaPropsMixin } from '../../utils/media-props-mixin';
|
||||
|
||||
export class MuxVideo extends MediaPropsMixin(MediaAttachMixin(MuxCustomVideo), MuxMediaDelegate) {
|
||||
constructor() {
|
||||
super();
|
||||
this.attach(this.target);
|
||||
}
|
||||
|
||||
disconnectedCallback(): void {
|
||||
super.disconnectedCallback?.();
|
||||
|
||||
if (!this.hasAttribute('keep-alive')) {
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
export class MuxVideo extends MediaAttachMixin(CustomMediaElement('video', MuxVideoMedia)) {}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
import { NativeHlsCustomMedia, NativeHlsMediaDelegate } from '@videojs/core/dom/media/native-hls';
|
||||
import { CustomMediaElement } from '@videojs/core/dom/media/custom-media-element';
|
||||
import { NativeHlsMedia } from '@videojs/core/dom/media/native-hls';
|
||||
import { MediaAttachMixin } from '../../store/media-attach-mixin';
|
||||
import { MediaPropsMixin } from '../../utils/media-props-mixin';
|
||||
|
||||
export class NativeHlsVideo extends MediaPropsMixin(MediaAttachMixin(NativeHlsCustomMedia), NativeHlsMediaDelegate) {
|
||||
constructor() {
|
||||
super();
|
||||
this.attach(this.target);
|
||||
}
|
||||
|
||||
disconnectedCallback(): void {
|
||||
super.disconnectedCallback?.();
|
||||
|
||||
if (!this.hasAttribute('keep-alive')) {
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
export class NativeHlsVideo extends MediaAttachMixin(CustomMediaElement('video', NativeHlsMedia)) {}
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import { SimpleHlsCustomMedia } from '@videojs/core/dom/media/simple-hls';
|
||||
import { SpfMedia } from '@videojs/spf/dom';
|
||||
import { CustomMediaElement } from '@videojs/core/dom/media/custom-media-element';
|
||||
import { SimpleHlsMedia } from '@videojs/core/dom/media/simple-hls';
|
||||
import { MediaAttachMixin } from '../../store/media-attach-mixin';
|
||||
import { MediaPropsMixin } from '../../utils/media-props-mixin';
|
||||
|
||||
export class SimpleHlsVideo extends MediaPropsMixin(MediaAttachMixin(SimpleHlsCustomMedia), SpfMedia) {
|
||||
constructor() {
|
||||
super();
|
||||
this.attach(this.target);
|
||||
}
|
||||
}
|
||||
export class SimpleHlsVideo extends MediaAttachMixin(CustomMediaElement('video', SimpleHlsMedia)) {}
|
||||
|
||||
Reference in New Issue
Block a user