(instance: ComponentInstance<PlayerAPI>)
| 92 | } |
| 93 | |
| 94 | constructor(instance: ComponentInstance<PlayerAPI>) { |
| 95 | super(instance); |
| 96 | |
| 97 | this._initStore(); |
| 98 | new MediaStoreSync(instance); |
| 99 | |
| 100 | const context = { |
| 101 | player: null, |
| 102 | scope: getScope(), |
| 103 | qualities: new VideoQualityList(), |
| 104 | audioTracks: new AudioTrackList(), |
| 105 | $provider: signal<MediaProvider | null>(null), |
| 106 | $props: this.$props, |
| 107 | $store: this.$store as MediaStore, |
| 108 | } as MediaContext; |
| 109 | |
| 110 | if (__DEV__) { |
| 111 | const logPrinter = new LogPrinter(instance); |
| 112 | effect(() => { |
| 113 | logPrinter.logLevel = this.$props.logLevel(); |
| 114 | }); |
| 115 | } |
| 116 | |
| 117 | if (__DEV__) context.logger = new Logger(); |
| 118 | context.remote = new MediaRemoteControl(__DEV__ ? context.logger : undefined); |
| 119 | context.$iosControls = computed(this._isIOSControls.bind(this)); |
| 120 | context.textTracks = new TextTrackList(); |
| 121 | context.textTracks[TEXT_TRACK_CROSSORIGIN] = this.$props.crossorigin; |
| 122 | context.textRenderers = new TextRenderers(context); |
| 123 | context.ariaKeys = {}; |
| 124 | |
| 125 | this._media = context; |
| 126 | provideContext(mediaContext, context); |
| 127 | |
| 128 | this.orientation = new ScreenOrientationController(instance); |
| 129 | |
| 130 | new FocusVisibleController(instance); |
| 131 | new MediaKeyboardController(instance, context); |
| 132 | new ThumbnailsLoader(instance); |
| 133 | if (__DEV__) new MediaEventsLogger(instance, context); |
| 134 | |
| 135 | const request = new MediaRequestContext(); |
| 136 | this._stateMgr = new MediaStateManager(instance, request, context); |
| 137 | this._requestMgr = new MediaRequestManager(instance, this._stateMgr, request, context); |
| 138 | |
| 139 | context.delegate = new MediaPlayerDelegate( |
| 140 | this._stateMgr._handle.bind(this._stateMgr), |
| 141 | context, |
| 142 | ); |
| 143 | |
| 144 | new MediaLoadController(instance, this.startLoading.bind(this)); |
| 145 | } |
| 146 | |
| 147 | protected override onAttach(el: HTMLElement): void { |
| 148 | el.setAttribute('tabindex', '0'); |
nothing calls this directly
no test coverage detected