- if (options.mode === 'webtorrent') {
- this.player.webtorrent().on('resolutionChange', (_: any, d: any) => this.handleResolutionChange(d))
- this.player.webtorrent().on('autoResolutionChange', (_: any, d: any) => this.trigger('autoResolutionChange', d))
- }
-
- if (options.mode === 'p2p-media-loader') {
- this.player.p2pMediaLoader().on('resolutionChange', (_: any, d: any) => this.handleResolutionChange(d))
- }
-
- this.player.tech(true).on('loadedqualitydata', () => {
- setTimeout(() => {
- // Replay a resolution change, now we loaded all quality data
- if (this.lastResolutionChange) this.handleResolutionChange(this.lastResolutionChange)
- }, 0)
- })
-