@applicaster/zapp-react-native-utils 13.0.0-alpha.2635505531 → 13.0.0-alpha.3244448100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,15 @@
1
1
  import { BehaviorSubject } from "rxjs";
2
2
  import { TapSeekController } from "./TapSeekController";
3
3
  import { LongPressSeekController } from "./LongPressSeekController";
4
- import { playerManager } from "../../../appUtils";
5
4
  import { SEEK_TYPE } from "../const";
6
5
  import { createLogger } from "../../../logger";
6
+ import { Player } from "../../../appUtils/playerManager/player";
7
+ import { SeekKeyHandlerListener } from "../../../appUtils/keyInputHandler/KeyInputHandler";
8
+ import {
9
+ ISeekController,
10
+ ISeekControllerDelegate,
11
+ SeekIncrementalBaseStrategy,
12
+ } from "./ISeekController";
7
13
 
8
14
  export const { log_warning, log_debug, log_info, log_error, log_verbose } =
9
15
  createLogger({
@@ -11,142 +17,244 @@ export const { log_warning, log_debug, log_info, log_error, log_verbose } =
11
17
  subsystem: "TVSeekController",
12
18
  });
13
19
 
14
- export class TVSeekController {
15
- private static instance: TVSeekController;
16
- public static getInstance() {
17
- if (!TVSeekController.instance) {
18
- TVSeekController.instance = new TVSeekController();
19
- }
20
+ export enum SEEK_STRATEGY {
21
+ TAP_SEEK = "TAP_SEEK",
22
+ AUTO_SEEK = "AUTO_SEEK",
23
+ }
20
24
 
21
- return TVSeekController.instance;
22
- }
25
+ const CONFIG_TAP_SEEK = {
26
+ CLICKS_BEFORE_PAUSE: 0,
27
+ };
28
+
29
+ const CONFIG_LONG_PRESS = {
30
+ TIMER_INTERVAL_MS: 200,
31
+ };
32
+
33
+ const LONG_PRESS_THRESHOLD = 500;
34
+ const SEEK_END_TIMEOUT_DURATION = 700;
23
35
 
24
- // -- SHARED STATE ACROSS STRATEGIES --
25
- public currentSeekType: SEEK_TYPE | null = null;
26
- public delayedSeekOffset: number | null = null;
36
+ export class TVSeekController
37
+ implements SeekKeyHandlerListener, ISeekControllerDelegate
38
+ {
39
+ public delayedSeekPosition: number | null = null;
40
+ private readonly playerController: Player;
27
41
  private delayedSeekProgressSubject = new BehaviorSubject<number | null>(null);
42
+ isPlayerInitiallyPaused: null | boolean = null;
43
+ currentSeekType: SEEK_TYPE | null = null;
28
44
 
29
- // -- STRATEGY INSTANCES --
30
- private tapSeekController: TapSeekController;
31
- private longPressSeekController: LongPressSeekController;
45
+ private currentSeekController: ISeekController;
46
+ private readonly tapSeekController: TapSeekController;
47
+ private readonly longPressSeekController: LongPressSeekController;
48
+ private longPressThresholdTimeout: any | null = null;
49
+ private seekEndTimeout: any | null = null;
32
50
 
33
- // Example config for long press
34
- private config = {
35
- LONG_PRESS_THRESHOLD: 500,
36
- TIMER_INTERVAL_MS: 300,
37
- SKIP_INCREMENT_STEP: 5,
38
- MAX_SKIP_PER_TICK: 300,
39
- INITIAL_SKIP_AMOUNT: 10,
40
- };
51
+ constructor(playerController: Player) {
52
+ this.playerController = playerController;
41
53
 
42
- private constructor() {
43
- this.tapSeekController = new TapSeekController(this);
54
+ this.tapSeekController = new TapSeekController(
55
+ this,
56
+ new SeekIncrementalBaseStrategy(),
57
+ CONFIG_TAP_SEEK
58
+ );
44
59
 
45
60
  this.longPressSeekController = new LongPressSeekController(
46
61
  this,
47
- this.config
62
+ new SeekIncrementalBaseStrategy(),
63
+ CONFIG_LONG_PRESS
48
64
  );
65
+
66
+ this.currentSeekController = this.tapSeekController;
49
67
  }
50
68
 
51
- getDelayedSeekProgressObservable() {
69
+ getDelayedSeekProgressObservable = () => {
52
70
  return this.delayedSeekProgressSubject;
53
- }
71
+ };
54
72
 
55
- getSeekMethods() {
56
- return {
57
- onForwardPress: () =>
58
- this.tapSeekController.onPressStart(SEEK_TYPE.FORWARD),
59
- onRewindPress: () =>
60
- this.tapSeekController.onPressStart(SEEK_TYPE.REWIND),
61
-
62
- onForwardLongPress: () => {
63
- this.longPressSeekController.onPressStart(SEEK_TYPE.FORWARD);
64
- this.tapSeekController.reset();
65
- },
66
- onRewindLongPress: () => {
67
- this.longPressSeekController.onPressStart(SEEK_TYPE.REWIND);
68
- this.tapSeekController.reset();
69
- },
70
- onForwardPressOut: () => this.longPressSeekController.onPressEnd(),
71
- onRewindPressOut: () => this.longPressSeekController.onPressEnd(),
72
- };
73
- }
73
+ setStrategy = (seekStrategy: SEEK_STRATEGY) => {
74
+ switch (seekStrategy) {
75
+ case SEEK_STRATEGY.TAP_SEEK:
76
+ this.currentSeekController = this.tapSeekController;
77
+ log_debug("TVSeekController: setStrategy - TAP_SEEK");
78
+
79
+ break;
80
+ case SEEK_STRATEGY.AUTO_SEEK:
81
+ this.currentSeekController = this.longPressSeekController;
82
+ log_debug("TVSeekController: setStrategy - AUTO_SEEK");
83
+
84
+ break;
85
+ default:
86
+ }
87
+ };
88
+
89
+ handleStartSeek = (seekType: SEEK_TYPE) => {
90
+ this.currentSeekType = seekType;
91
+
92
+ if (this.isPlayerInitiallyPaused === null) {
93
+ this.isPlayerInitiallyPaused = this.playerController.isPaused();
94
+ }
74
95
 
75
- // ---------------------------
76
- // SHARED METHODS
77
- // ---------------------------
96
+ this.clearLongPressThresholdTimeout();
97
+ this.clearSeekCompleteTimeout();
98
+ this.setStrategy(SEEK_STRATEGY.TAP_SEEK);
99
+ this.currentSeekController.onStartSeek(seekType);
78
100
 
79
- /** Called by either strategy to accumulate offset while paused. */
80
- handleDelayedSeek(eventType: SEEK_TYPE, skipTime: number) {
81
- const player = this.getPlayer();
82
- if (!player) return;
101
+ this.longPressThresholdTimeout = setTimeout(() => {
102
+ this.setStrategy(SEEK_STRATEGY.AUTO_SEEK);
103
+ this.currentSeekController.onStartSeek(seekType);
104
+ }, LONG_PRESS_THRESHOLD);
105
+ };
106
+
107
+ onForwardPress = (): boolean => {
108
+ this.handleStartSeek(SEEK_TYPE.FORWARD);
109
+
110
+ return true;
111
+ };
112
+
113
+ onRewindPress = (): boolean => {
114
+ this.handleStartSeek(SEEK_TYPE.REWIND);
83
115
 
84
- // If not previously delayed, we pause the first time
85
- if (this.delayedSeekOffset === null) {
86
- this.pausePlayer();
116
+ return true;
117
+ };
118
+
119
+ onSeekEnd = () => {
120
+ this.currentSeekController.onSeekEnd();
121
+ this.setStrategy(SEEK_STRATEGY.TAP_SEEK);
122
+ };
123
+
124
+ onRewindPressOut = () => {
125
+ this.onSeekEnd();
126
+ };
127
+
128
+ onForwardPressOut = () => {
129
+ this.onSeekEnd();
130
+ };
131
+
132
+ public onVideoProgress = (position: number) => {
133
+ if (this.delayedSeekPosition !== null) {
134
+ return;
87
135
  }
88
136
 
89
- const newOffset = (this.delayedSeekOffset || 0) + skipTime;
90
- const currentPos = player.getPosition();
137
+ // TODO: If 1 second after seek, send
138
+
139
+ this.delayedSeekProgressSubject.next(position);
140
+ };
141
+
142
+ handleDelayedSeek = (offset: number = 0) => {
143
+ this.handlePlayerPause();
144
+
145
+ const currentPos =
146
+ this.delayedSeekPosition === null
147
+ ? this.playerController.getPosition()
148
+ : this.delayedSeekPosition;
149
+
91
150
  let targetPos = currentPos;
92
151
 
93
- if (eventType === SEEK_TYPE.FORWARD) {
94
- targetPos = Math.min(currentPos + newOffset, player.getDuration());
152
+ if (this.currentSeekType === SEEK_TYPE.FORWARD) {
153
+ targetPos = Math.min(
154
+ currentPos + offset,
155
+ this.playerController.getSeekableDuration()
156
+ );
157
+ } else if (this.currentSeekType === SEEK_TYPE.REWIND) {
158
+ targetPos = Math.max(0, currentPos - offset);
95
159
  } else {
96
- targetPos = Math.max(0, currentPos - newOffset);
160
+ log_warning(
161
+ `TVSeekController: handleDelayedSeek - invalid seek type: ${this.currentSeekType}`
162
+ );
97
163
  }
98
164
 
99
- this.delayedSeekOffset = newOffset;
100
-
101
165
  log_debug(
102
- `TVSeekController: handleDelayedSeek - targetPos: ${targetPos}, offset: ${newOffset}, skipTime: ${skipTime}`
166
+ `TVSeekController: handleDelayedSeek - targetPos: ${targetPos}, skipTime: ${offset}`
103
167
  );
104
168
 
169
+ const prevValue = this.delayedSeekProgressSubject.getValue();
170
+
171
+ if (prevValue !== null) {
172
+ const delta = Math.abs(prevValue - targetPos);
173
+
174
+ if (delta < 1) {
175
+ return;
176
+ }
177
+ }
178
+
179
+ this.delayedSeekPosition = targetPos;
105
180
  this.delayedSeekProgressSubject.next(targetPos);
106
- }
181
+ };
107
182
 
108
- seekPlayer(offset: number) {
109
- const player = this.getPlayer();
110
- if (!player || !this.currentSeekType) return;
111
- player[this.currentSeekType](offset);
112
- this.playerPlay();
113
- }
183
+ handleSeekTo = (newPosition: number) => {
184
+ this.playerController.seekTo(newPosition);
185
+
186
+ if (!this.isPlayerInitiallyPaused) {
187
+ this.playerController.play();
188
+ }
189
+ };
114
190
 
115
- playerPlay() {
116
- const player = this.getPlayer();
117
- if (!player) return;
191
+ handleSeek = (offset: number) => {
192
+ this.playerController[this.currentSeekType](offset);
118
193
 
119
- if (player.isPaused()) {
120
- player.play();
194
+ if (!this.isPlayerInitiallyPaused) {
195
+ this.playerController.play();
121
196
  }
122
- }
197
+ };
123
198
 
124
- pausePlayer() {
125
- const player = this.getPlayer();
126
- if (!player) return;
127
- player.pause();
128
- }
199
+ handleSeekComplete = () => {
200
+ this.clearSeekCompleteTimeout();
201
+
202
+ this.seekEndTimeout = setTimeout(() => {
203
+ if (this.delayedSeekPosition !== null) {
204
+ this.handleSeekTo(this.delayedSeekPosition);
205
+ }
206
+
207
+ log_debug(
208
+ `handleSeekComplete: Seek finished, type: ${this.currentSeekController.title}, seekPosition: ${this.delayedSeekPosition}. Reset all states and seek position.`
209
+ );
210
+
211
+ this.resetAll();
212
+ }, SEEK_END_TIMEOUT_DURATION);
213
+ };
214
+
215
+ isAutoSeeking = (): boolean => {
216
+ return this.longPressSeekController.isLongPressActive;
217
+ };
218
+
219
+ handlePlayerPause = () => {
220
+ if (this.playerController.isPaused()) {
221
+ return;
222
+ }
223
+
224
+ this.playerController.pause();
225
+ };
226
+
227
+ clearSeekCompleteTimeout = () => {
228
+ if (this.seekEndTimeout === null) {
229
+ return;
230
+ }
231
+
232
+ clearTimeout(this.seekEndTimeout);
233
+ this.seekEndTimeout = null;
234
+ };
235
+
236
+ clearLongPressThresholdTimeout = () => {
237
+ if (this.longPressThresholdTimeout === null) {
238
+ return;
239
+ }
240
+
241
+ clearTimeout(this.longPressThresholdTimeout);
242
+ this.longPressThresholdTimeout = null;
243
+ };
129
244
 
130
- /**
131
- * Reset *all* relevant state and strategy controllers
132
- */
133
245
  resetAll() {
134
246
  log_debug("TVSeekController: Reset all states");
135
247
  this.currentSeekType = null;
136
- this.delayedSeekOffset = null;
137
- this.delayedSeekProgressSubject.next(null);
138
248
 
139
- this.tapSeekController.reset();
140
- this.longPressSeekController.reset();
141
- }
249
+ this.delayedSeekPosition = null;
250
+ this.isPlayerInitiallyPaused = null;
142
251
 
143
- private getPlayer() {
144
- const player = playerManager.getInstanceController();
252
+ this.clearSeekCompleteTimeout();
253
+ this.clearLongPressThresholdTimeout();
145
254
 
146
- if (!player) {
147
- log_warning("TVSeekController: No valid player controller found");
148
- }
255
+ this.tapSeekController.reset();
256
+ this.longPressSeekController.reset();
149
257
 
150
- return player;
258
+ this.setStrategy(SEEK_STRATEGY.TAP_SEEK);
151
259
  }
152
260
  }
@@ -1,73 +1,53 @@
1
- import { ISeekController } from "./ISeekController";
2
- import { SEEK_TYPE, MAX_SEEK_TIME, SKIP_TIME_BASE } from "../const";
3
- import { log_debug, TVSeekController } from "./TVSeekController";
4
-
5
- const getSkipTime = (multiplier: number) =>
6
- Math.min(MAX_SEEK_TIME, SKIP_TIME_BASE * multiplier);
1
+ import {
2
+ ISeekController,
3
+ ISeekControllerDelegate,
4
+ SeekIncrementalBaseStrategy,
5
+ } from "./ISeekController";
6
+ import { SEEK_TYPE } from "../const";
7
+ import { log_debug } from "./TVSeekController";
8
+
9
+ interface TapPressConfig {
10
+ CLICKS_BEFORE_PAUSE: number;
11
+ }
7
12
 
8
13
  export class TapSeekController implements ISeekController {
9
- private tapSequenceTimeout: NodeJS.Timeout | null = null;
10
- private seekMultiplier = 1;
11
- private readonly ON_PRESS_RESET_DURATION = 500; // ms
12
-
13
- constructor(private parent: TVSeekController) {}
14
-
15
- onPressStart(seekType: SEEK_TYPE) {
16
- log_debug(`TapSeekController: start tap seek type: ${seekType}.`);
14
+ readonly title = "TapSeek";
15
+ constructor(
16
+ private seekControllerDelegate: ISeekControllerDelegate,
17
+ private seekIncrementalStrategy: SeekIncrementalBaseStrategy,
18
+ private config: TapPressConfig
19
+ ) {}
17
20
 
18
- const prevSeekType = this.parent.currentSeekType;
21
+ onStartSeek = (seekType: SEEK_TYPE) => {
22
+ log_debug(`${this.title}: start tap seek type: ${seekType}.`);
19
23
 
20
- if (prevSeekType !== seekType) {
21
- this.reset();
22
- }
23
-
24
- this.parent.currentSeekType = seekType;
25
-
26
- if (this.tapSequenceTimeout) {
27
- clearTimeout(this.tapSequenceTimeout);
28
- this.tapSequenceTimeout = null;
29
- }
30
-
31
- this.tapSequenceTimeout = setTimeout(() => {
32
- if (this.parent.delayedSeekOffset !== null) {
33
- this.parent.seekPlayer(this.parent.delayedSeekOffset);
34
- }
24
+ const skipTime = this.seekIncrementalStrategy.getSkipTime();
25
+ const seekMultiplier = this.seekIncrementalStrategy.getSkipMultiplier();
35
26
 
27
+ if (seekMultiplier > this.config.CLICKS_BEFORE_PAUSE) {
36
28
  log_debug(
37
- `TapSeekController: Tap sequence timeout fired, delayedSeekOffset: ${this.parent.delayedSeekOffset}.`
29
+ `${this.title}: handle delayed seek type:${seekType} - skipTime: ${skipTime}, seekMultiplier: ${seekMultiplier}.`
38
30
  );
39
31
 
40
- this.parent.resetAll();
41
- }, this.ON_PRESS_RESET_DURATION);
42
-
43
- const clicksBeforePause = 3;
44
- const skipTime = getSkipTime(this.seekMultiplier);
45
-
46
- if (this.seekMultiplier > clicksBeforePause) {
47
- log_debug(
48
- `TapSeekController: handle delayed seek type:${seekType} - skipTime: ${skipTime}.`
49
- );
50
-
51
- this.parent.handleDelayedSeek(seekType, skipTime);
32
+ this.seekControllerDelegate.handleDelayedSeek(skipTime);
52
33
  } else {
53
34
  log_debug(
54
- `TapSeekController: handle seek type:${seekType} - skipTime: ${skipTime}.`
35
+ `${this.title}: handle seek type:${seekType} - skipTime: ${skipTime}.`
55
36
  );
56
37
 
57
- this.parent.seekPlayer(skipTime);
38
+ this.seekControllerDelegate.handleSeek(skipTime);
58
39
  }
59
40
 
60
- this.seekMultiplier++;
61
- }
41
+ this.seekIncrementalStrategy.increment();
42
+ };
62
43
 
63
- reset() {
64
- log_debug("TapSeekController: Reset states");
44
+ onSeekEnd = () => {
45
+ this.seekControllerDelegate.handleSeekComplete();
46
+ };
65
47
 
66
- this.seekMultiplier = 1;
48
+ reset = () => {
49
+ log_debug("{this.title}: Reset states");
67
50
 
68
- if (this.tapSequenceTimeout) {
69
- clearTimeout(this.tapSequenceTimeout);
70
- this.tapSequenceTimeout = null;
71
- }
72
- }
51
+ this.seekIncrementalStrategy.reset();
52
+ };
73
53
  }
@@ -1,10 +1,6 @@
1
1
  export const SKIP_TIME_BASE = 10;
2
2
 
3
- export const ON_PRESS_RESET_DURATION = 2000;
4
-
5
- export const ON_HOLD_INTERVAL = 500;
6
-
7
- export const MAX_SEEK_TIME = 60;
3
+ export const MAX_SEEK_TIME = 600;
8
4
 
9
5
  export enum SEEK_TYPE {
10
6
  FORWARD = "forward",
@@ -1,7 +1 @@
1
1
  export { useLanguageData } from "./useLanguageData";
2
-
3
- export { useAutoSeek } from "./useAutoSeek";
4
-
5
- export { useTapSeek } from "./useTapSeek";
6
-
7
- export { useSeek, withUseSeek } from "./useSeek";
@@ -1,180 +0,0 @@
1
- import { Player } from "./player";
2
- import { BehaviorSubject } from "rxjs";
3
-
4
- export class DelayedSeekPlayerWrapper extends Player {
5
- private wrappedPlayer: Player;
6
- private delayedSeekPosition: number;
7
- private wasPlaying: boolean;
8
-
9
- constructor(props, player: Player) {
10
- super(props);
11
- this.wrappedPlayer = player;
12
- this.delayedSeekPosition = null;
13
-
14
- this.wrappedPlayer.addListener({
15
- id: "Master-Wrapper-Listener",
16
- listener: this,
17
- });
18
-
19
- this.onPlayerSeekComplete = this.onPlayerSeekComplete.bind(this);
20
- }
21
-
22
- getOverlayObservable = () => {
23
- return this.wrappedPlayer.getOverlayObservable();
24
- };
25
-
26
- getEntryObservable = (): BehaviorSubject<ZappEntry | null> => {
27
- return this.wrappedPlayer.getEntryObservable();
28
- };
29
-
30
- getEntry = (): ZappEntry | null => this.wrappedPlayer.getEntry();
31
-
32
- getListener = (): QuickBrickPlayer.SharedPlayerCallBacks => {
33
- return this.wrappedPlayer.getListener();
34
- };
35
-
36
- togglePlayPause = () => {
37
- this.wrappedPlayer.togglePlayPause();
38
- };
39
-
40
- selectTrack = (_track) => this.wrappedPlayer.selectTrack(_track);
41
-
42
- // Implement all default methods by delegating them to wrapped player
43
- public seekTo = (position: number) => {
44
- this.wrappedPlayer.seekTo(position);
45
- };
46
-
47
- public isPlaying = () => {
48
- return this.wrappedPlayer.isPlaying();
49
- };
50
-
51
- public isPaused = () => {
52
- return this.wrappedPlayer.isPaused();
53
- };
54
-
55
- public play = () => {
56
- this.wrappedPlayer.play();
57
- };
58
-
59
- public pause = () => {
60
- this.wrappedPlayer.pause();
61
- };
62
-
63
- getState = () => {
64
- const currentState = this.wrappedPlayer.getState();
65
-
66
- if (this.delayedSeekPosition === null) {
67
- return currentState;
68
- }
69
-
70
- return {
71
- ...currentState,
72
- contentPosition: this.delayedSeekPosition,
73
- isPaused: false,
74
- seekPosition: this.delayedSeekPosition,
75
- };
76
- };
77
-
78
- forward = (deltaTime: number) => {
79
- if (this.delayedSeekPosition !== null) {
80
- this.delayedSeekPosition += deltaTime;
81
- this.playerState.seekPosition = this.delayedSeekPosition;
82
-
83
- this.onVideoProgress({
84
- currentTime: this.playerState.seekPosition,
85
- duration: this.getDuration(),
86
- seekableDuration: this.playerState.seekableDuration,
87
- isLive: this.playerState.isLive,
88
- });
89
-
90
- // this.scheduleResumePlayback(DELAYED_SEEK_DELAY, this.delayedSeekPosition);
91
-
92
- return;
93
- }
94
-
95
- if (this.playerState.seekPosition == null) {
96
- this.playerState.seekPosition = this.playerState.contentPosition;
97
- }
98
-
99
- this.playerState.seekPosition += deltaTime;
100
-
101
- this.wrappedPlayer.forward(deltaTime);
102
- };
103
-
104
- rewind = (deltaTime: number) => {
105
- if (this.delayedSeekPosition !== null) {
106
- this.delayedSeekPosition -= deltaTime;
107
-
108
- if (this.delayedSeekPosition < 0) {
109
- this.delayedSeekPosition = 0;
110
- }
111
-
112
- this.playerState.seekPosition = this.delayedSeekPosition;
113
-
114
- this.onVideoProgress({
115
- currentTime: this.playerState.seekPosition,
116
- duration: this.getDuration(),
117
- seekableDuration: this.playerState.seekableDuration,
118
- isLive: this.playerState.isLive,
119
- });
120
-
121
- // this.scheduleResumePlayback(DELAYED_SEEK_DELAY, this.delayedSeekPosition);
122
-
123
- return;
124
- }
125
-
126
- if (this.playerState.seekPosition == null) {
127
- this.playerState.seekPosition = this.playerState.contentPosition;
128
- }
129
-
130
- this.playerState.seekPosition -= deltaTime;
131
- this.wrappedPlayer.rewind(deltaTime);
132
- };
133
-
134
- public getConfig = () => this.wrappedPlayer.getConfig();
135
-
136
- // TODO: replace with enum of supported orientations
137
- isFullScreenSupported(): boolean {
138
- return this.wrappedPlayer.isFullScreenSupported();
139
- }
140
-
141
- public supportsNativeControls = (): boolean =>
142
- this.wrappedPlayer.supportsNativeControls();
143
-
144
- public supportNativeCast = (): boolean =>
145
- this.wrappedPlayer.supportNativeCast();
146
-
147
- public isInDelayedSeek = () => this.delayedSeekPosition !== null;
148
-
149
- public enterDelayedSeek() {
150
- if (this.delayedSeekPosition !== null) {
151
- return;
152
- }
153
-
154
- if (this.playerState.seekPosition === null) {
155
- this.playerState.seekPosition = this.playerState.contentPosition;
156
- }
157
-
158
- this.delayedSeekPosition = this.playerState.seekPosition;
159
-
160
- if (!this.isPaused()) {
161
- this.wasPlaying = true;
162
- this.wrappedPlayer.pause();
163
- }
164
- }
165
-
166
- public exitDelayedSeek() {
167
- if (this.delayedSeekPosition === null) {
168
- return;
169
- }
170
-
171
- this.wrappedPlayer.seekTo(this.delayedSeekPosition);
172
-
173
- if (this.wasPlaying) {
174
- this.wasPlaying = false;
175
- this.wrappedPlayer.play();
176
- }
177
-
178
- this.delayedSeekPosition = null;
179
- }
180
- }